Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
web sockets - can I send extra info about client in the moment of connecting to server using socket.connect() method

I am working on webrtc project and I have client(s) with input video stream, client that will show input stream and server. I am using webrtc and websockets. Every client is connected to signaling server. I want to know how server can know if connected client is client with input video stream or it is client that will show some streams. Can I send some extra info in the moment of connecting client side to server? Client is written in Javascript and server in Python. Maybe I can use some parameters in socket.connect() method?

Server handling connecting:

@sio.event
async def connect(sid, environ):
    print('Connected', sid)
    sessionIDs.append(sid)

    await sio.emit('ready', room=ROOM, skip_sid=sid)
    sio.enter_room(sid, ROOM)

Connecting client to server:

socket.connect();

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just add your data as GET parameter in the websocket url, or use a differente path.

const socket = io("ws://localhost:3000?arg1=1&arg2=2");
// or
const socket = io("ws://localhost:3000/path1");

And on the server to get them:

io.on("connection", (socket) => {
  console.log(socket.handshake.query); // prints { x: "42", EIO: "4", transport: "polling" }
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!