NAME

Mojo::WebSocketProxy::Dispatcher

DESCRIPTION

Using this module you can forward websocket JSON-RPC 2.0 requests to RPC server. See Mojo::WebSocketProxy for details on how to use hooks and parameters.

INHERITED METHODS

Mojolicious::Controller

app, continue, cookie, every_cookie, every_param, every_signed_cookie, finish, flash, helpers, match, on, param, redirect_to, render, render_later, render_maybe, render_to_string, rendered, req, res, respond_to, session, signed_cookie, stash, tx, url_for, validation, write, write_chunk

Mojo::Base

attr, import, new, tap

METHODS

open_connection

Run while opening new wss connection. Run hook when connection is opened. Set finish connection callback.

on_message

Handle message - parse and dispatch request messages. Dispatching action and forward to RPC server. Note that all incoming JSON messages are first normalised using NFC.

before_forward

Run hooks.

after_forward

Run hooks.

dispatch

Dispatch request using message json key.

forward

Forward call to RPC server using global and action hooks. Don't forward call to RPC if any before_forward hook returns response. Or if there is instead_of_forward action.

_get_error_details

Generates and returns a hash for error reporting

ok

SEE ALSO

Mojolicious::Plugin::WebSocketProxy, Mojo::WebSocketProxy, Mojo::WebSocketProxy::Backend, Mojo::WebSocketProxy::Dispatcher, Mojo::WebSocketProxy::Config Mojo::WebSocketProxy::Parser