由于某些原因,我的節點服務器無法提供路由/socket.io/socket.io.js,所以我總是會收到404錯誤。我嘗試編譯不同的節點版本(當前版本為0.6.13,該版本也可以在實際運行的服務器上運行)。從app.js info: socket.io started嘗試調用socket.io.js時,我得到并沒有錯誤。我從本地主機和端口8000嘗試,我使用express框架這是來自app.js的代碼:var express = require('express') , app = require('express').createServer() , io = require('socket.io').listen(app, { log: true });app.listen(8000);app.configure(function() { app.use(express.static(__dirname + '/public')); app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));});io.sockets.on('connection', function (socket) { // all other stuff here
找不到socket.io.js
楊魅力
2019-12-27 15:27:06