From d94af938932827625b6a52da6642f8320a861623 Mon Sep 17 00:00:00 2001 From: Norio Kobota Date: Fri, 14 Feb 2014 13:37:04 +0900 Subject: [PATCH] revise configuration files. --- sample/etc/conf.d/websocket.conf | 11 ++--------- sample/etc/conf.d/websocket.conf.sample | 26 ++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/sample/etc/conf.d/websocket.conf b/sample/etc/conf.d/websocket.conf index af3b5fb..9915633 100644 --- a/sample/etc/conf.d/websocket.conf +++ b/sample/etc/conf.d/websocket.conf @@ -37,19 +37,12 @@ websocket.server = ( "proto" => "websocket" ), # for mosquitto + # refer to "^\/mqtt\/*" => ( "host" => "127.0.0.1", "port" => 1883, "proto" => "tcp", "type" => "binary", - "subproto" => "binary" ) - - # for mosquitto (base64 version) - #"^\/mqtt\/*" => ( "host" => "127.0.0.1", - # "port" => 1883, - # "proto" => "tcp", - # "type" => "text", - # "subproto" => "base64" ) - + "subproto" => "mqttv3.1" ) ) websocket.ping_interval = 5 # send PING per 5 secs diff --git a/sample/etc/conf.d/websocket.conf.sample b/sample/etc/conf.d/websocket.conf.sample index f4b9c2e..11e27dd 100644 --- a/sample/etc/conf.d/websocket.conf.sample +++ b/sample/etc/conf.d/websocket.conf.sample @@ -24,11 +24,13 @@ websocket.server = ( # all the back of # is treated as a comment. "origins" => ( "^http:\/\/192\.168\.0\..*", "^http:\/\/res2\.com\/.*" ) ), + # default values "/tcp" => ( "host" => "192.168.0.5", "port" => "10000", # "proto" => "tcp" # default value # "type" => "text" # default value + # "subproto" => nil # noting ), # If type section is set binary, @@ -49,18 +51,36 @@ websocket.server = ( # all the back of # is treated as a comment. "type" => "binary" ), + # If subproto section is set some string, + # RFC-6455: + # mod_websocket just reply specified string as Sec-WebSocket-Protocol at handshake response + # But a backend server application never knows Sec-WebSocket-Protocol comes from a client. + # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + # hybi-00: + # no meanings. just ignored. + # + # This function is implemented for + # + "/subproto" => ( + "host" => "192.168.0.7", + "port" => "10000", + "subproto" => "some_string" + ), + # WebSocket Proxy, # mod_websocket only transfers the data between a backend server and a client. # And X-Forwarded-For header is appended to an initial handshake request. "/websocket" => ( - "host" => "192.168.0.7", + "host" => "192.168.0.8", "port" => "10000", "proto" => "websocket", # You can use origin restriction even if WebSocket Proxy. # But, it's not necessary to use. "origins" => ( "^http:\/\/192\.168\.0\..*" ), - # "type" section has no meanings. - "type" => "binary" + # "type" section has no meanings.(just ignored) + "type" => "binary", + # "subproto" section has no meanings.(just ignored) + "subproto" => "foo" ) ) }