NNG TLS config implementation - create it in server or client mode - set CA certifivate if needed (from file or string) - set chain certificate if needed (from file or string) - set auth mode (required, optional or none) - for auth mode set own certificate and key (from file or string) - assign the filled config to the dealer or listener object - start dealer or listener
{WebSocket} WebSocket connection accepted by the {WebSocketApp} server Not for manual construction Passed to the on_connect and om_message callbacks Methods: send(ubyte[])
{WebSocketApp} WebSocket Application (server to accept http-urgrade connections) Constructor: WebSocketApp( strind URI to listen should start with "ws://" on_connect callback: void function ( WebSocket*, void* context ) on_message callback: void function ( WebSocket*, ubyte[], void* context ) void* context ) Methods: start() - start server to listen
{ WebSocketClient } Client class to handle websocket connection Constructor: WebSocketClient ( string URI to connect to, string origin URI to connect from ws_options struct to set options Usage: void onmsg( string msg ){ do_whatever(msg); } c = WebSocketClient("ws://server/path"); while(c.state != ws_state.CLOSED ){ c.poll(); c.dispatch(&onmsg); }
{ urlparse } Simplified regexp-based URL parser Usage: auto u = urlparse("http://server/path?key=val#anchor"); writeln(u.host); writeln(u.toString);