dopod0901 2015-07-31 10:02
浏览 96

用wamp连接到本地websocket

I am trying to do a tutorial on websockets, however it seems I can't even connect to the websocket.

I am using wamp 2.5 and I have php_sockets extension enabled.

In the video, the guy's url for the homepage is: youtube:app:8000, and mine is l/chat (I turned localhost into l a while ago), and it opens up normally.

Then, he sets up the server like so:

var socket = new WebSocket("ws://127.0.0.1:2000");

And since it's just the first step with no more code, when he goes to the homepage (youtube:app:8000) he gets this message in chrome:

Error during websocket handshake

Whereas I get:

Error in connection establishment

When setting my new websocket, I tried all 3 following options, but the error is always the same (I never get to the handshake).

var socket = new WebSocket("ws://l:2000");
var socket = new WebSocket("ws://localhost:2000");
var socket = new WebSocket("ws://127.0.0.1:2000");

What can be the problem?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 lammps拉伸应力应变曲线分析
    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
    • ¥30 python代码,帮调试
    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python