Closed Sididi closed 1 year ago
The createWebSocketConnection function doesn't take the credentials, it takes the following object https://github.com/matsjla/league-connect/blob/master/src/websocket.ts#L71
I suppose we should do some checks on the incoming value to make it "safer". Try with the object in that link and let me know if it still does not work
Maybe update this part of the README
By the way I have tried what you said and still got the same error 🙏
import { createWebSocketConnection, LeagueClient, authenticate } from 'league-connect'
const ws = await createWebSocketConnection({
authenticationOptions: {
awaitConnection: true,
}
})
Running on Node 16.16.0, literally no other line of code, happens as soon as I loggin in League of Legends
Yeah, I'll update the readme and investigate - thanks for the update
Yup, I'm able to reproduce. I'll try to find a fix
any fix ETA?
Hey, maybe it's will little help. It's seems to be problem with too quickly trying to connect to websocket when League client not open websocket.
tested code working fine:
const credentials = await authenticate({
awaitConnection: true,
pollInterval: 15000
})
const client = new LeagueClient(credentials);
wait(15000);
localws = await createWebSocketConnection(credentials)
tested code with that error without delay before connect to websocket:
const credentials = await authenticate({
awaitConnection: true,
pollInterval: 15000
})
const client = new LeagueClient(credentials);
//missing delay
localws = await createWebSocketConnection(credentials)
Yeah I think it's https://github.com/matsjla/league-connect/issues/56 again, maybe I didn't fix it properly
Yeah I think it's #56 again, maybe I didn't fix it properly
So you know how to fix it?
Well, I thought I knew
Should be resolved now. Please re-open or create another issue if the issue persists!
Hello, I keep getting ECONNREFUSED errors since the new release each time I open LeagueClient, even when trying a code as simple as that
Do you have any idea where it comes from?
Stack trace (doesn't really give useful infos though)