Error using moonlink in deno
I'm trying to update my bot to use moonlink given issues I've been having with other libraries and I get the following error:
Any ideas on how to fix it?
8 Replies
I'm using the following code:
Deno's inbuilt Websocket doesn't support headers that's the reason you receive that error.
Options you have are:
- poly-fill the Global Websocket with some libraries like ws or others.
- use an unstable WebSocketStream API refer: https://questions.deno.com/m/1205621973657321534
- Wait for @1Lucas1.apk (better option ig)
Headers for WebSocket client - Deno
I need to connect Deno (as a client) to a WebSocket server that requires custom headers on connection. I can't seem to find any currently supported method to accomplish this since the
WebSocket
API only allows for the url
and protocols
parameters.
Is there any known best practice to accomplish this?I always forget about the stability of Deno and Bun
NO STABILITY, COMPATIBILITY
Welcome to JS Ecosystem.
How now for me it's 11h at night
Tomorrow morning, I do a search to better understand these problems
And I bring a solution
And also check the bun
It's 8:41 A.M for me and we're in the #help channel
here is 23:12
Sleep
Tomorrow, it is better, I think more clearly, with sleep is very bad
Have a good day for you and sorry for the delay of the solution
If you want to skip the direct solution of the package, you can find a package on the internet with webSocket working with headers, and put as a global until you do it in the package officially
Global polyfills don't work for my usecase because it breaks the discord api library im using, so unless there's a way I can only pass it to moonlink that doesn't work