discordjs / RPC

A simple RPC client for Discord
MIT License
466 stars 191 forks source link

WebSocket transport doesn't work when IPC does #78

Closed Malkierian closed 4 years ago

Malkierian commented 4 years ago

So far as I can tell, the WebSocket simply fails to open the connection, but IPC succeeds with the exact same setup and information (just switching the transport value when creating Discord.Client). I need the WS version to work because I need to use this through Browserify (but this is still failing when running through Node before Browserify). I don't know what to debug myself, but if you could give me a direction to go in, I can get you whatever information you need. I have debugged websocket.js a bit, and found that ws has a ready state of 3 immediately after it tries instantiating it, so the connection is just silently failing for whatever reason.

Malkierian commented 4 years ago

Oh, and rpc.login's catch is simply outputting "undefined".

devsnek commented 4 years ago

WebSocket requires being whitelisted by discord.

Malkierian commented 4 years ago

By that, I assume you mean that list that has a limit of 50 people that you set in the developer portal? Well that's no good. Is there a way, then, to make IPC work in browser environments like Chromium (where the net module isn't avaiable)?

devsnek commented 4 years ago

That's not what I mean. WebSocket transport is not available without explicitly being given access.

Malkierian commented 4 years ago

Ah, well I need to prove that this can work before anyone can go to Discord for approval. Anything on my question about IPC without net?

devsnek commented 4 years ago

there is no such functionality.