handshake failed due to invalid connection header
when i try to connect with moonlink i get this:
the server is on my pc i tried both localhost and 127.0.0.1 and both gives the same result

81 Replies
what version of lavalink and moonlink you using??
moonlink 4.60.4 and lavalink 4.1.1
can u share the part of code where u create moonlink manager and the part where u initialize the manager
sure
btw moonlink says initialized like normal and only the lavalink terminal says that it couldn't connect
@ComicallyBad hlpp
@UnschooledGamer
try secure: false , my guess
I'll check, it's been a while since I tested moonlink.js


CC: @Ehi
Should first try just manually inputting all the node info in case its just not accessing process.env properly. Then turn secure off. See if that changes anything
@Ehi Did you manage to solve the problem?
not really
all I did was try this and it didn't work
Can you provide me with all the logs and debug logs? From what I saw, it's not the port they mentioned, nor would it be requesting it.
on moonlink just put this information
options*
GG @Ehi, you just advanced to level 1!
WebSocket handlers attached to main
hmmm
let's take a look at the source code
do you have access to node_modules?
if you have it in /moonlink.js/dist/src/entities/Node.js
on line 74 around there
let headers = {
Authorization: this.password,
"User-Id": this.manager.options.clientId,
"Client-Name": this.manager.options.clientName,
};
if (this.manager.options.resume && sessionId) {
headers["Session-Id"] = sessionId;
this.manager.emit("debug",
Moonlink.js > Node > Connect > Using resume session ID: ${sessionId} for ${this.identifier}
);
}
console.log(headers)
below that put
@Ehiput what?
the headers are already there

on line 77 I noticed that there is a header that is placed there
put console.log(headers)
then send me what returns

added the log to below l77 btw
in
/dist/src/services/Websocket.js
on the line

console.log(options) on line 43
it says upgrade here

maybe its changed somewhere else? or lavalink thinks its keep alive for some reason??
why is it giving an error with header[keep-alive] I want to know where it is coming from

if it is a wrong key or something undefined
Have you tried using "localhost" or "0.0.0.0" as host?
i tried localhost but not 0.0.0.0
We can also test postman to see if it's not a problem with lavalink
making a connection through WS if it works it is in the package through WebSocket something that is incorrect
If it doesn't work, there's a problem with Lavalink.
do you think you can test that? i don't have postman installed rn
I think so
@Ehi try again later
npm install git+https://github.com/Ecliptia/moonlink.js.git#dev
GitHub
GitHub - Ecliptia/moonlink.js: MoonLink.js is a simple package for ...
MoonLink.js is a simple package for lavalink client, perfect for you to create your discord bot with songs, and very simple and easy to use. - GitHub - Ecliptia/moonlink.js: MoonLink.js is a simpl...
and see if it fixed the problem
if you don't let me know
"if you do let me know" ig 😄
There are people who disappear from the face of the earth when I test with it, so I don't have to do it :)
still the same :|

i even checked the code in node modules and the latest commit to make sure I downloaded the correct version and it looks like i did

btw i noticed that I have event listeners for nodeReady and nodeError but neither of them trigger
GG @Ehi, you just advanced to level 2!
i don't know if that helps
its not connecting to lavalink like successfully connecting to the lavalink , so they dont fire if im right
Wait, I'll see how to activate the Lavalink debugs
I think this way we can see what he accuses is incorrect.
Troubleshooting - Lavalink Docs
Lavalink troubleshooting steps.
Let's do the following, in application.yml change the Info for this debug one, it should certainly show something
@Ehi
Root would throw alot stuffs 🙃
this is the new full log

@1Lucas1.apk look there
Connection: "keep-alive"
the worst thing is that this is not defined in the requests
.
Hmm Saw that when I was trying to check the issue
You're on vsc, Lucas? (not vscodium)
WebStorm
🙃
VSCode.dev would work ig
let him do " live share "
To you.
Then you can collaboratively try to fix it
but I have
vsc
Oh
Ok
Then use vsc
What is the name of the plugin to do in collaboration?
Ask him to share his workspace with live share extension/plugin
You too download it on your side
Here's the link, If you didn't find it. https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare
Live Share - Visual Studio Marketplace
Extension for Visual Studio Code - Real-time collaborative development from the comfort of your favorite tools.
I downloaded it and I'll send you the invite
Not me 🙃
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
That guy needs to....
I understand now
You'll join he's workspace 😀
@Ehi
install this plugin
i have it
activate it and send me the code to write and read so I can fix it, I can't reproduce this error on my machine
I'm just going to mess with node_modules
Visual Studio Code for the Web
Build with Visual Studio Code, anywhere, anytime, entirely in your browser.
it has to be in the folder
what folder
to the bot
while I fix it, I'll test it on the server
i somehow closed vscode
heres the new link https://prod.liveshare.vsengsaas.visualstudio.com/join?1E4954DC45E72F063FBB45409DB1D7BF62BB
Visual Studio Code for the Web
Build with Visual Studio Code, anywhere, anytime, entirely in your browser.
strangely I don't see node_modules
.vsls.json
create this file and put this, and restart vsc
@Ehi
for me to fill the node_modules
that doesn't work
how about we try the webstorm share feature
yeah
@UnschooledGamer now that I noticed, he's using bun
There are some packages in bun that work differently than the native node ones
@Ehi npm install git+https://github.com/Ecliptia/moonlink.js.git#dev
GitHub
GitHub - Ecliptia/moonlink.js: MoonLink.js is a simple package for ...
MoonLink.js is a simple package for lavalink client, perfect for you to create your discord bot with songs, and very simple and easy to use. - GitHub - Ecliptia/moonlink.js: MoonLink.js is a simpl...
now it should work
Oh. Moonlink should've detected that, in the logs he sent for Moonlink.js
sim, estranhamente ainda deu nodejs ali
yes, strangely it still gave nodejs there
I noticed from the headers I saw somewhere
bun/version
that's what I saw