SOLVED
How to auth to wasteof socketio?
Sample code maybe (js code also will be fine)
My current code: connects to API but idk where and how to authenticate (I have token/session)
import os
os.system("pip install python-socketio[client]")
os.system("clear")
import socketio
sio = socketio.Client()
@sio.event
def dsconnect(data):
print('I received a message!')
print(data)
@sio.on('updateMessageCount')
def on_message(data):
print('I received a message!')
print(data)
@sio.event
def connect():
print("I'm connected!")
#sio.emit('login', {'Authorization': api.token})
sio.connect("https://api.wasteof.money/")
idk python, but try
sio.connect("https://api.wasteof.money/", {
auth: {
token: "TOKEN_HERE"
}
})
You can post in js too
const { io } = require(`socket.io-client`)
io(`https://api.wasteof.money`, {
auth: {
token: token
}
});
socket = the function
Thanks. I will try now
Have you tested it? Doesn't work for me
I have, whats your code?
Jeffalo just sent the same thing as you did. I think I cant translate to python :(
Iĺl try to translate to python, even though Idk python
Ok ty :P
Oh I’m dumb.. Thank you!! It worked!!!!