简体   繁体   English

使用JavaScript将Websocket连接到Qt Fortune Server

[英]Connecting Websocket to Qt Fortune Server with JavaScript

I am trying to connect to the Qt Fortune Server Example, with this HTML/Javascript Code : http://jsfiddle.net/gr0bhrqr/ 我正在尝试使用此HTML / Javascript代码连接到Qt Fortune服务器示例: http : //jsfiddle.net/gr0bhrqr/

I edited this line of code: 我编辑了以下代码行:

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

In Chrome, I get this error in the console: 在Chrome中,我在控制台中收到此错误:

WebSocket connection to 'ws://localhost:50745/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_ABORTED WebSocket与'ws:// localhost:50745 /'的连接失败:WebSocket握手时出错:net :: ERR_CONNECTION_ABORTED

I also tried with Firefox - no connection. 我也尝试使用Firefox-没有连接。 My firewall is off - the given port is free. 我的防火墙关闭-给定的端口是空闲的。

What can I do? 我能做什么?

The Qt Fortune Server example does not implement the Websocket protocol. Qt Fortune Server示例未实现Websocket协议。

You can find Qt Websocket examples here . 您可以在此处找到Qt Websocket示例。

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

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