简体   繁体   English

HTML5网络套接字和代理配置

[英]HTML5 websockets and proxy configs

I am using Debian 7 and browser Google Chrome (35). 我正在使用Debian 7和浏览器Google Chrome(35)。 When I am trying to pass echo test on websockets.org there is an error in console: 当我尝试通过websockets.org上的echo测试时,控制台出现错误:

WebSocket connection to 'ws://echo.websocket.org/?encoding=text' failed: Failed to send WebSocket frame. 

My PC is behind the proxy with Squid 3, but another users behind the same proxy can passing echo tests on websockets.org (squid configs are the same for each user). 我的电脑在Squid 3的代理后面,但是同一代理后面的另一个用户可以通过websockets.org上的回声测试(每个用户的鱿鱼配置都相同)。

How can I debug this issue? 如何调试此问题?

I have turned off all my reverse proxy servers (nginx, apache) 我已关闭所有反向代理服务器(nginx,apache)

If i write the following code in my Google chrome console : 如果我在Google chrome控制台中编写以下代码:

socket = new WebSocket("ws://echo.websocket.org/");

Then I can not see any frames (there is no handshacking phase) in the network page (Google chrome dev tools). 然后,我在网络页面(Google chrome开发工具)中看不到任何框架(没有手动黑客攻击阶段)。

UPDATE: 更新:

The interesting thing, that websockets connection working for me with the latest version of the Iceweasel browser (Firefox), but it does not work with Google Chrome or Chromium. 有趣的是,该websockets连接对我来说适用于最新版本的Iceweasel浏览器(Firefox),但不适用于Google Chrome或Chromium。

I am starting Google Chrome with the following command: 我正在使用以下命令启动Google Chrome:

/usr/bin/google-chrome-stable %U --proxy-server="http://172.16.20.12:4554"

What else can be done? 还有什么可以做的? Many thanks in advance. 提前谢谢了。

The handshaking are not frames, is just plain HTTP. 握手不是帧,只是纯HTTP。 If you initiated a Websocket connection, and the server returns a HTTP 101 Switching Protocols response, that is the handshake. 如果您启动了Websocket连接,并且服务器返回HTTP 101交换协议响应,那就是握手。

Have you tried with WSS:// rather than WS://? 您是否尝试过使用WSS://而不是WS://?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM