DF
Dimensional FunBloxs
Any way to reconnect when node restarts
I'm currently using the reconnect: { basic: whatever } property in my nodes. While this works whenever the node requests a websocket reconnect it doesn't attempt to reconnect whenever the node is restarting
V
viztea•572d ago
lavalink doesn't request reconnects
could you elaborate?
I'll probably have to port over the nodejs reconnection logic anyways
B
Bloxs•569d ago
Whenever the socket reconnects
Any updates regarding this? As it’s fairly inconvenient for me to restart the bot whenever lavalink gets restarted
V
viztea•569d ago
yeah sorry, I'll look into it right now
B
Bloxs•569d ago
It’s fine, it hasn’t gotten on my nerves to the point I wrote my own reconnect function like I’ve done before it other issues lol
V
viztea•569d ago
looks to be an issue with the ws lib
doesn't catch closes
Love how Deno has completely removed websockets from their stdlib
B
Bloxs•569d ago
iirc they replaced it with a upgradeWebsocket method on the Deno namespace where you provide a http request, it's a bit jank though
V
viztea•569d ago
That would probably be better than me just writing my own ws lib
pretty sure that's for the server though
yeah incoming http request
the only client-side websocket class is through web apis
and that doesn't support headers
B
Bloxs•569d ago
The Websocketstream api supports headers, although that's probably gonna take more work to implement than just writing a custom socket wrapper
V
viztea•569d ago
hmm
it's also unstable
B
Bloxs•569d ago
Sockets don't seem to be getting much attention in deno as a whole, pogsockets was the only working one I could find that actually somewhat worked
V
viztea•569d ago
i copied it from the stdlib before they removed it
B
Bloxs•569d ago
there's other solutions but they either don't work or have conflicting docs (references code that doesn't exist in the library)
it's been a mess, I may investigate websocketsteam one day as socketio is a library I used a ton and having an alt for deno would be nice
V
viztea•569d ago
I'll probs write my own ws lib one day
rn im just gonna copy stuff over from the stdlib
B
Bloxs•569d ago
apparently if all you're using headers for is auth then you can do
var ws = new WebSocket("ws://username:password@example.com/service");
or var ws = new WebSocket("ws://my_token@example.com/service");
seems kinda dumb though that even with the web standard there's no official way to add headersV
viztea•569d ago
Lavalink requires other headers
User-Id, Client-Name etc
So found the issue
When the server doesn't send a close frame the socket just dies
And I don't handle that
V
viztea•569d ago
V
viztea•569d ago
should just be able to publish this and fix your issue
V
viztea•569d ago
there we go
V
viztea•569d ago
B
Bloxs•569d ago
ty
129Members
View on DiscordWant results from more Discord servers?
More Posts