Socket.io无法加载资源 [英] Socket.io Failed to load resource
本文介绍了Socket.io无法加载资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有错误
Failed to load resource http://localhost:3250/socket.io/1/?t=1376856906369
当我尝试使用socket.io进行某些操作时(加载工作正常)
when i try do something with socket.io (loading work properly)
这是我的第一行服务器
var express = require('express')
, http = require('http')
, mysql = require('mysql');
var app = express();
var server = http.createServer(app);
var io = require('socket.io').listen(server);
server.listen(8080);
app.set('view engine', 'swig');
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(__dirname + '/lib'));
推荐答案
您正在端口8080上启动服务器,但是您试图从端口3250获取socket.io.因此,您需要更改此行:>
You are starting the server on port 8080, but you are trying to get socket.io from port 3250. So you either need to change this line:
//server.listen(8080);
server.listen(3250);
...或者您在浏览器中使用" http://localhost:8080
"或仅使用" http://localhost
".
...or you use "http://localhost:8080
" or just "http://localhost
" in your browser.
这篇关于Socket.io无法加载资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文