Proxy websocket messages to and from PostgreSQL.
Note: This dose not handle authentication and authorization, ensure you implement them at other layers.
- class pgwebsocket.PgWebsocket(dburl: str, bind: str = '127.0.0.1', port: int = 9000)¶
An application to handle websocket to Postgresql proxying.
- on_connect(callback: Callable[[...], Awaitable[bool]]) None¶
Register a callback after connection.
- on_disconnect(callback: Callable[[...], Awaitable[bool]]) None¶
Register a callback after disconnection.
- on_msg(route: str) Callable[[Callable[[...], Awaitable[bool]]], None]¶
Register a map of callbacks to handle diffrent messages.
Callbacks can return True to stop processing this message.
- run(url: str = '/') None¶
Start listening for connections.