首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Crossbar球童反向代理

Crossbar球童反向代理
EN

Stack Overflow用户
提问于 2016-02-08 22:07:38
回答 1查看 970关注 0票数 2

如何设置与纵横制路由器通信的caddy的反向代理?

我有一个带有crossbar路由器的docker,它监听localhost8080,我使用caddy作为反向代理。

在Caddyfile下面:

代码语言:javascript
复制
`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’不返回任何内容。

在来自chrome的标题下面:

响应

代码语言:javascript
复制
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

请求

代码语言:javascript
复制
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

在框架下面:

代码语言:javascript
复制
[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}}}}]

和控制台错误:

代码语言:javascript
复制
WebSocket connection to 'ws://78.46.244.23/ws' failed: Invalid frame header
EN

回答 1

Stack Overflow用户

发布于 2017-10-01 06:01:21

你的Caddyfile中有一个拼写错误:

Upgrade "WebSoket"

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35271620

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档