前端部分代码:
index.js代码:
const socket = io('http://www.cdrbcx.com.cn:3000');
nodejs代码
var app = require('express')();
var http = require('http').createServer(app);
var io = require('socket.io')(http);
app.get('/', function (req, res) {
res.sendFile(__dirname + '/index.html');
});
io.on('connection', function (socket) {
socket.on('disconnect', function () {
console.log('user disconnected');
});
});
http.listen(3000, function () {
console.log('listening on *:3000');
});
手机端eruda.js看到的请求
感谢各位大佬,很着急!!