Skip to content

Commit a07eedf

Browse files
Pass custom authentication data with client connection (Fixes #661)
1 parent 9b3ffc2 commit a07eedf

File tree

17 files changed

+1829
-2274
lines changed

17 files changed

+1829
-2274
lines changed

examples/client/asyncio/fiddle_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def hello(a, b, c):
2020

2121

2222
async def start_server():
23-
await sio.connect('http://localhost:5000')
23+
await sio.connect('http://localhost:5000', auth={'token': 'my-token'})
2424
await sio.wait()
2525

2626

examples/client/javascript/fiddle_client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const io = require('socket.io-client')
22
const port = process.env.PORT || 5000;
33

4-
const socket = io('http://localhost:' + port);
4+
const socket = io('http://localhost:' + port, {auth: {token: 'my-token'}});
55

66
socket.on('connect', () => {
77
console.log(`connect ${socket.id}`);

0 commit comments

Comments
 (0)