2016-02-08 98 views
2

我怎麼能設置一個與crossbar路由器交談的球童的反向代理?Crossbar caddy反向代理

我有一個dockbar,它有一個在localhost 8080上監聽的crossbar路由器,我使用caddy作爲反向代理。

下面的Caddyfile:

`0.0.0.0:80 
proxy /ws localhost:8080{ 
    proxy_header Connection {>Connection} 
    proxy_heade Upgrade {>Upgrade} 
} 
header /ws { 
    Upgrade "WebSoket" 
    Connection "Upgrade" 
}` 

'tcpflow 8080' 返回任何結果當我嘗試連接。

下面從鉻頭:

RESPONSE

HTTP/1.1 101 Switching Protocols 
Connection: Upgrade 
Sec-Websocket-Accept: r/PdCQJibmcb5XrfVbnSXJMuf9g= 
Sec-Websocket-Protocol: wamp.2.json 
Server: Caddy 
Server: Crossbar/0.11.1 
Upgrade: WebSocket 
X-Powered-By: AutobahnPython/0.10.9 
Date: Tue, 09 Feb 2016 14:12:04 GMT 

REQUEST

GET ws://78.46.244.23/ws HTTP/1.1 
Host: 78.46.244.23 
Connection: Upgrade 
Pragma: no-cache 
Cache-Control: no-cache 
Upgrade: websocket 
Origin: chrome://newtab 
Sec-WebSocket-Version: 13 
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTM 
    like Gecko) Chrome/48.0.2564.103 Safari/537.36 
Accept-Encoding: gzip, deflate, sdch 
Accept-Language: it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4 
Sec-WebSocket-Key: OaEUxWnqjZWyfLypeYxeXw== 
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits 
Sec-WebSocket-Protocol: wamp.2.json 

下方的框架:

[1,"realm1",{"roles":{"caller":{"features":{"caller_identification":true,"progressive_call_results":true}},"callee":{"features":{"progressive_call_results":true}},"publisher":{"features":{"subscriber_blackwhite_listing":true,"publisher_exclusion":true,"publisher_identification":true}},"subscriber":{"features":{"publisher_identification":true}}}}] 

和控制檯錯誤:

WebSocket connection to 'ws://78.46.244.23/ws' failed: Invalid frame header 

回答

0

你有一個錯字在你Caddyfile:

Upgrade "WebSoket"