Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.hassio.ingress Namespace Reference

Classes

class  HassIOIngress
 

Functions

str _forwarded_for_header (str|None forward_for, str peer_name)
 
CIMultiDict|dict[str, str] _init_header (web.Request request, str token)
 
bool _is_websocket (web.Request request)
 
dict[str, str] _response_header (aiohttp.ClientResponse response)
 
None _websocket_forward (web.WebSocketResponse|ClientWebSocketResponse ws_from, web.WebSocketResponse|ClientWebSocketResponse ws_to)
 
None async_setup_ingress_view (HomeAssistant hass, str host)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
dictionary INIT_HEADERS_FILTER
 
int MAX_SIMPLE_RESPONSE_SIZE = 4194000
 
int MIN_COMPRESSED_SIZE = 128
 
dictionary RESPONSE_HEADERS_FILTER
 

Detailed Description

Hass.io Add-on ingress service.

Function Documentation

◆ _forwarded_for_header()

str homeassistant.components.hassio.ingress._forwarded_for_header ( str | None  forward_for,
str  peer_name 
)
private
Create X-Forwarded-For header.

Definition at line 229 of file ingress.py.

◆ _init_header()

CIMultiDict | dict[str, str] homeassistant.components.hassio.ingress._init_header ( web.Request  request,
str  token 
)
private
Create initial header.

Definition at line 235 of file ingress.py.

◆ _is_websocket()

bool homeassistant.components.hassio.ingress._is_websocket ( web.Request  request)
private
Return True if request is a websocket.

Definition at line 278 of file ingress.py.

◆ _response_header()

dict[str, str] homeassistant.components.hassio.ingress._response_header ( aiohttp.ClientResponse  response)
private
Create response header.

Definition at line 269 of file ingress.py.

◆ _websocket_forward()

None homeassistant.components.hassio.ingress._websocket_forward ( web.WebSocketResponse | ClientWebSocketResponse  ws_from,
web.WebSocketResponse | ClientWebSocketResponse  ws_to 
)
private
Handle websocket message directly.

Definition at line 287 of file ingress.py.

◆ async_setup_ingress_view()

None homeassistant.components.hassio.ingress.async_setup_ingress_view ( HomeAssistant  hass,
str  host 
)
Auth setup.

Definition at line 51 of file ingress.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.hassio.ingress._LOGGER = logging.getLogger(__name__)
private

Definition at line 27 of file ingress.py.

◆ INIT_HEADERS_FILTER

dictionary homeassistant.components.hassio.ingress.INIT_HEADERS_FILTER
Initial value:
1 = {
2  hdrs.CONTENT_LENGTH,
3  hdrs.CONTENT_ENCODING,
4  hdrs.TRANSFER_ENCODING,
5  hdrs.ACCEPT_ENCODING, # Avoid local compression, as we will compress at the border
6  hdrs.SEC_WEBSOCKET_EXTENSIONS,
7  hdrs.SEC_WEBSOCKET_PROTOCOL,
8  hdrs.SEC_WEBSOCKET_VERSION,
9  hdrs.SEC_WEBSOCKET_KEY,
10 }

Definition at line 29 of file ingress.py.

◆ MAX_SIMPLE_RESPONSE_SIZE

int homeassistant.components.hassio.ingress.MAX_SIMPLE_RESPONSE_SIZE = 4194000

Definition at line 47 of file ingress.py.

◆ MIN_COMPRESSED_SIZE

int homeassistant.components.hassio.ingress.MIN_COMPRESSED_SIZE = 128

Definition at line 46 of file ingress.py.

◆ RESPONSE_HEADERS_FILTER

dictionary homeassistant.components.hassio.ingress.RESPONSE_HEADERS_FILTER
Initial value:
1 = {
2  hdrs.TRANSFER_ENCODING,
3  hdrs.CONTENT_LENGTH,
4  hdrs.CONTENT_TYPE,
5  hdrs.CONTENT_ENCODING,
6 }

Definition at line 39 of file ingress.py.