Modulevortex-ws-0.2.1GHC2024
Vortex.Ws.Door
The door a public websocket needs, in front of a host's sessions: a
socket systemd holds (or one bound here), a handshake within a deadline
from a page the settings name, a session slot for the door and for the
peer, and frames held to a size with compression off. The peer is the
connecting address, or behind a proxy its X-Real-IP, with an IPv6
address counted by its /64. Its settings are a vortex program
(Vortex.Ws.Door.Settings), settled ahead of time and read back here.
- 2 types
- 8 values
- Packagevortex-ws-0.2.1
- Exports10
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceDoor.hs
Where the door listens
3 declarationsThe one listening socket systemd hands over; anything else is a mistake in the unit, and fails.
Serving
6 declarationsServe where the settings say to listen, each admitted connection handed to the host as its peer and its Session.
Serve on a socket already listening. A connection that does not finish its handshake in time is closed; one from a page the settings do not name is answered 403, and one past a session cap 503, without a Session.
Where a connection's peer is read from.
Constructors
BehindProxyThe proxy's
X-Real-IP; a connection without one is the peerproxy.DirectThe connecting address.
Whether a page may open the door: its Origin must be one the settings name, exactly. A request without one is refused.
Frames and messages over the limit end the connection; compression stays off, so a small frame cannot inflate into a large one.
The peer a connection is charged to; see Vortex.Ws.Door.Peer.
Settings
1 declarationSettings settled from a program (Vortex.Ws.Door.Model), read back without elaborating anything and held to the fold again.