Socket.IO

Websocket Cloudflare with Nginx 520 error

五迷三道 提交于 2021-01-07 02:08:28
问题 I am jumping in on a project with some socket issues over SSL and Cloudflare... I know.. I have read about 50 different stack overflow posts and 200 blog posts to try to figure this out. The project works on my local dev server/computer just fine... I think I am on the right track - But could use some help/pointers if ya'll can. First, I thought it was weird that the /socket-io/ proxy_pass was at port 6379, the same as redis... Maybe it should be? When this was set at 6379, the socket

Socket.io keeps connecting repeatedly and ignores other events

纵饮孤独 提交于 2021-01-05 07:09:32
问题 I'm attempting to make a webapp where users can play toroidal chess with each other. This is my app.js, on the server: var express = require('express'); var app = express(); var http = require('http').Server(app); var io = require('socket.io')(http); var port = process.env.PORT || 8000; app.use(express.static('public')); app.get('/', function(req, res) { res.sendFile(__dirname + '/public/index.html'); console.log("Got request for homepage"); }); io.on('connection', function(socket){ console

Socket.io keeps connecting repeatedly and ignores other events

旧巷老猫 提交于 2021-01-05 07:07:47
问题 I'm attempting to make a webapp where users can play toroidal chess with each other. This is my app.js, on the server: var express = require('express'); var app = express(); var http = require('http').Server(app); var io = require('socket.io')(http); var port = process.env.PORT || 8000; app.use(express.static('public')); app.get('/', function(req, res) { res.sendFile(__dirname + '/public/index.html'); console.log("Got request for homepage"); }); io.on('connection', function(socket){ console

Socket.io keeps connecting repeatedly and ignores other events

↘锁芯ラ 提交于 2021-01-05 07:07:38
问题 I'm attempting to make a webapp where users can play toroidal chess with each other. This is my app.js, on the server: var express = require('express'); var app = express(); var http = require('http').Server(app); var io = require('socket.io')(http); var port = process.env.PORT || 8000; app.use(express.static('public')); app.get('/', function(req, res) { res.sendFile(__dirname + '/public/index.html'); console.log("Got request for homepage"); }); io.on('connection', function(socket){ console

Socket.io keeps connecting repeatedly and ignores other events

穿精又带淫゛_ 提交于 2021-01-05 07:07:30
问题 I'm attempting to make a webapp where users can play toroidal chess with each other. This is my app.js, on the server: var express = require('express'); var app = express(); var http = require('http').Server(app); var io = require('socket.io')(http); var port = process.env.PORT || 8000; app.use(express.static('public')); app.get('/', function(req, res) { res.sendFile(__dirname + '/public/index.html'); console.log("Got request for homepage"); }); io.on('connection', function(socket){ console

How To Implement React hook Socketio in Next.js

℡╲_俬逩灬. 提交于 2021-01-02 20:34:47
问题 I have tried to find a way from Google but the results can remain the same http://localhost:8000/socket.io/?EIO=3&transport=polling&t=MnHYrvR i try this wan medium try other ways, the results remain the same and for the front end I have tried, socket io inside the hook component and outside the scope, the results remain the same http://localhost:8000/socket.io/?EIO=3&transport=polling&t=MnHYrvR this is my code from server: app.prepare().then(() => { const server = express(); const setServer =

Error using socket.io along with webpack-dev-server

 ̄綄美尐妖づ 提交于 2021-01-02 05:53:23
问题 Quick question guys, I am trying to use webpack-dev-server with socketio, but after trying different things, i figured both of the clients are listening to the same port '3000' and I end up with some kind of handshake error that goes away if I dont use webpack-dev-server on the same port.. here is my server config const PORT = process.env.PORT || 3000; new WebpackDevServer(webpack(config), { publicPath: config.output.publicPath, hot: true, historyApiFallback: true, setup(app) { const server =

Bazel + Angular + SocketIO Causes: Uncaught TypeError: XMLHttpRequest is not a constructor

旧时模样 提交于 2021-01-02 05:10:54
问题 I want to add ngx-socket-io to my Angular application. I use Bazel to run my Angular dev-server. Unfortunately ngx-socket-io doesn't seem to work with the ts_devserver out of the box. I get this error in the browser console: Uncaught TypeError: XMLHttpRequest is not a constructor at ts_scripts.js?v=1587802098203:16776 at Object.23.../transport (ts_scripts.js?v=1587802098203:16780) at o (ts_scripts.js?v=1587802098203:11783) It seems to be caused by xmlhttprequest-ssl which is a dependency of

Socket.io gets “bad handshake method” on Firefox, but not Chrome or Safari

回眸只為那壹抹淺笑 提交于 2021-01-01 06:30:24
问题 [This is a duplicate of socket.io issue #2717 on Github. No answers there, I'd love to get some troubleshooting hints...] I have a test page (below) that creates a socket.io connection back to the server, then listens for and logs 'time' messages. It works as expected for recent Chrome and Safari on OSX 10.10.5. I'm using Socket.io 1.5.0 for all tests. With Firefox 49.0.1, each POST request gets a response with bad handshake method . There is no Socket.io connected... message in the console,

Is it a good idea to run Socket.io on a Firebase Cloud Function?

荒凉一梦 提交于 2020-12-29 19:05:08
问题 Implementing it works, but I have read that due to how Cloud Functions are designed they are not the best way to use socket.io. Why? 回答1: Actually, socket.io does not work with Cloud Functions. Cloud Functions have the following properties that make them incompatible with long-lived socket connections: The maximum duration of a Cloud Function can only be 9 minutes. The socket will be forced closed after that time. This is counter to the normal expectation of socket.io to keep a socket