Python3.1中的WebSockets握手问题 [英] WebSockets in Python3.1 handshake problem

查看:576
本文介绍了Python3.1中的WebSockets握手问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用python3.1,所以我在这里找到了一个html5 websocket片段:

i am using python3.1 ,so i found a html5 websocket snippet here:

http://www.nublue.co.uk/blog/threaded-python-websocket-server-and-javascript- client /

我用chrome测试。

I test with chrome.

发送握手包后,web客户端没有按预期响应(websocket.onopen未被触发)。我确实收到了客户的请求。
.i尝试了很多次。它只是不起作用。

After send handshake packet,web client has no response as expect(websocket.onopen is not fired).I do receive client's request. .i tried many times.It just not work.

这是一个.NET代码:

Here is a .NET code:

http://nugget.codeplex.com/

我测试一下,它工作正常。所以我的镀铬是可以的。
我想知道有没有python3.x演示代码可以给我一个帮助。

I test it,it works fine.so my chrome is ok. I wanna know is there any python3.x demo code can give me a help.

我的机器:
WIN7 pro X86

And my machine: WIN7 pro X86

谢谢。

推荐答案

noVNC 项目(HTML5 VNC客户端)包含一个名为 wsproxy ,它是通用TCP代理的WebSockets。它透明地支持WebSockets协议的v75和v76(具有新的握手)。

The noVNC project (a HTML5 VNC client) contains a python 2.X (but should be easy to convert to 3.X) utility named wsproxy which is a WebSockets to generic TCP proxy. It transparently supports v75 and v76 (which has new handshake) of the WebSockets protocol.

如果您仍在使用它,那至少可能是一个有用的参考。

If you're still working on it, that might be a helpful reference at least.

免责声明:我制作了noVNC和wsproxy。

Disclaimer: I made noVNC and wsproxy.

这篇关于Python3.1中的WebSockets握手问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆