我正在运行该应用程序,但它没有找到 socket.io 并给了我 404。
这是客户:
<script src="http://game-test-1.herokuapp.com/socket.io/socket.io.js"></script>
<script>var socket = io.connect('http://game-test-1.herokuapp.com');</script>
这是服务器:
var express = require('express'),
routes = require('./routes'),
user = require('./routes/user'),
http = require('http'),
path = require('path'),
express = require("express"),
app = express(),
server = http.createServer(app),
io = require('socket.io').listen(server);
server.listen(80);
我尝试更改端口并这样做http://game-test-1.herokuapp.com:81/...
,但这给了我一个错误
如何正确链接 socket.io?