Skip to content

Sockets

Classes

SocketDefault

1
2
3
4
5
SocketDefault(
    address: StrShaSoc, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

Socket

Bind using default protocol. See default_socket_type option.


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


SocketFastcgi

1
2
3
4
5
6
SocketFastcgi(
    address: StrShaSoc, 
    nph: bool = False, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

Socket

Bind to the specified socket using FastCGI.


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


SocketHttp

1
2
3
4
5
6
SocketHttp(
    address: StrShaSoc, 
    http11: bool = False, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

Socket

Bind to the specified socket using HTTP


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


SocketHttps

1
2
3
4
5
6
7
8
9
SocketHttps(
    address: StrShaSoc, 
    cert: str, 
    key: str, 
    ciphers: str | None = None, 
    client_ca: str | None = None, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

Socket

Bind to the specified socket using HTTPS


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


get_certbot_paths

1
2
3
.get_certbot_paths(
    domain: str,  # (1)!
) -> tuple[str, str]
  1. Domain name to get filepaths for.

Returns a tuple of paths for files (certificates_chain, private_key) from Certbot https://certbot.eff.org

Those paths can be used to pass into Socket initializer.

Note

If files not found empty strings are returned.


SocketRaw

1
2
3
4
5
SocketRaw(
    address: StrShaSoc, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

Socket

Bind to the specified UNIX/TCP socket using RAW protocol.

Raw mode allows you to directly parse the request in your application callable. Instead of getting a list of CGI vars/headers in your callable you only get the file descriptor soon after accept().

You can then read()/write() to that file descriptor in full freedom.

Note

Raw mode disables request logging.

Warning

Use it as a low-level socket wrapper.


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


SocketScgi

1
2
3
4
5
6
SocketScgi(
    address: StrShaSoc, 
    nph: bool = False, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

Socket

Bind to the specified UNIX/TCP socket using SCGI protocol.


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


SocketShared

1
2
3
4
5
6
SocketShared(
    address: str, 
    undeferred: bool = False, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

Socket

Create a shared socket for advanced jailing or IPC purposes.

Allows you to create a socket early in the server's startup and use it after privileges drop or jailing. This can be used to bind to privileged (<1024) ports.

Shared sockets are a way to share sockets among various uWSGI components: you can use that to share a socket between the fastrouter and uWSGI instance.


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


SocketUdp

1
2
3
4
5
SocketUdp(
    address: StrShaSoc, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

Socket

Run the udp server on the specified address.

Note

Mainly useful for SNMP or shared UDP logging.


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


SocketUwsgi

1
2
3
4
5
6
SocketUwsgi(
    address: StrShaSoc, 
    persistent: bool = False, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

Socket

uwSGI specific socket using uwsgi protocol.


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


SocketUwsgis

1
2
3
4
5
6
7
8
9
SocketUwsgis(
    address: StrShaSoc, 
    cert: str, 
    key: str, 
    ciphers: str | None = None, 
    client_ca: str | None = None, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

SocketHttps

uwSGI specific socket using uwsgi protocol over SSL.


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


get_certbot_paths

1
2
3
.get_certbot_paths(
    domain: str,  # (1)!
) -> tuple[str, str]
  1. Domain name to get filepaths for.

Returns a tuple of paths for files (certificates_chain, private_key) from Certbot https://certbot.eff.org

Those paths can be used to pass into Socket initializer.

Note

If files not found empty strings are returned.


SocketZeromq

1
2
3
4
5
SocketZeromq(
    address: StrShaSoc, 
    bound_workers: Strlist = None, 
    modifier: Modifier = None
)

Socket

Introduce zeromq pub/sub pair.


alias

.alias: str = ''

Alias to address this value.


name_separator

.name_separator: str = ':'

Separator to add after name portion.


name_separator_strip

.name_separator_strip: bool = False

Strip leading and trailing name separator from the result.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.