Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocketIO Server Doesn't work. #21

Open
thevobos opened this issue Apr 1, 2023 · 3 comments
Open

SocketIO Server Doesn't work. #21

thevobos opened this issue Apr 1, 2023 · 3 comments

Comments

@thevobos
Copy link

thevobos commented Apr 1, 2023

Hi,

I'm using Socket.io with Node JS and I'm getting an error. Please can you give an example of how I should set a socket server with Socket.io server or nodejs?

@thevobos
Copy link
Author

thevobos commented Apr 1, 2023

i getting a an error message

Error Code :

Traceback (most recent call last):
File "main.py", line 83, in
File "main.py", line 48, in do_connect
File "main.py", line 26, in hello
File "usocketio/client.py", line 81, in connect
File "usocketio/client.py", line 45, in _connect_http
AssertionError: b'HTTP/1.1 400 Bad Request'

My Socket Server Code
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
const { Server } = require("socket.io");
const io = new Server(server);

app.get('/', (req, res) => {
res.send("selam");
});

io.on('connection', (socket) => {
console.log('a user connected');
});

server.listen(3009, () => {
console.log('listening on *:3000');
});

@danni
Copy link
Owner

danni commented Apr 2, 2023

Hi, I'm afraid all of this code is unsupported. Especially the SocketIO part. I don't know if SocketIO has changed any part of their requesting handshake.

The first step is to turn on logging of your requests (i.e. in Wireshark) and see if they make sense. Compare them to a Node SocketIO client and see what's different.

@thevobos
Copy link
Author

thevobos commented Apr 2, 2023

Thank you for your quick response,

I tested the whole platform. socket Io, Flask SocketIo. only the web socket is working. isn't working stable. i will use thr mqtt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants