Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialErrorResponse ¶ added in v0.5.0
DialErrorResponse returns the HTTP response from the WebSocket handshake error, if any.
Types ¶
type ClientOptions ¶
type ClientOptions struct { URL string // The URL of the WebSocket server DialContext context.Context // Optional WebSocket dial context DialOptions websocket.DialOptions // Optional WebSocket dial options Handshake HandshakeResponse // Optionally run after successful WebSocket handshake }
ClientOptions for Watch and Tunnel, implementing connect.Tunneler.
func (ClientOptions) Tunnel ¶
Tunnel implements connect.Tunneler and creates a connection over a WebSocket. On error a http.Response may be provided by DialErrorResponse.
func (ClientOptions) Watch ¶
func (o ClientOptions) Watch(ctx context.Context, propose connect.ReceiveProposal) error
Watch implements connect.Watcher and watches for session proposals. On error a http.Response may be provided by DialErrorResponse.
type HandshakeResponse ¶
HandshakeResponse is called after receiving the WebSocket handshake response from the server.
type ServerOptions ¶
type ServerOptions struct {
AcceptOptions websocket.AcceptOptions // Optional WebSocket accept options
}
ServerOptions for TunnelHandler and EndpointHandler.
func (ServerOptions) EndpointHandler ¶
func (o ServerOptions) EndpointHandler(ln connect.EndpointListener) http.Handler
EndpointHandler returns a new http.Handler for accepting WebSocket requests for watching endpoints.
func (ServerOptions) TunnelHandler ¶
func (o ServerOptions) TunnelHandler(ln connect.TunnelListener) http.Handler
TunnelHandler returns a new http.Handler for accepting WebSocket requests for tunneling.