MCPcopy Create free account
hub / github.com/python-websockets/websockets / unix_serve

Function unix_serve

src/websockets/sync/server.py:627–647  ·  view source on GitHub ↗

Create a WebSocket server listening on a Unix socket. This function accepts the same keyword arguments as :func:`serve`. It's only available on Unix. It's useful for deploying a server behind a reverse proxy such as nginx. Args: handler: Connection handler. It receiv

(
    handler: Callable[[ServerConnection], None],
    path: str | None = None,
    **kwargs: Any,
)

Source from the content-addressed store, hash-verified

625
626
627def unix_serve(
628 handler: Callable[[ServerConnection], None],
629 path: str | None = None,
630 **kwargs: Any,
631) -> Server:
632 """
633 Create a WebSocket server listening on a Unix socket.
634
635 This function accepts the same keyword arguments as :func:`serve`.
636
637 It's only available on Unix.
638
639 It's useful for deploying a server behind a reverse proxy such as nginx.
640
641 Args:
642 handler: Connection handler. It receives the WebSocket connection,
643 which is a :class:`ServerConnection`, in argument.
644 path: File system path to the Unix socket.
645
646 """
647 return serve(handler, unix=True, path=path, **kwargs)
648
649
650def is_credentials(credentials: Any) -> bool:

Callers 15

mainFunction · 0.90
mainFunction · 0.90
test_connectionMethod · 0.90
test_set_host_headerMethod · 0.90
test_connectionMethod · 0.50
test_connectionMethod · 0.50
start_serverMethod · 0.50

Calls 1

serveFunction · 0.70

Tested by 13

test_connectionMethod · 0.72
test_set_host_headerMethod · 0.72
test_connectionMethod · 0.40
test_connectionMethod · 0.40
start_serverMethod · 0.40
run_serverMethod · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…