OpenAsar / arrpc

Open Discord RPC server for atypical setups
https://arrpc.openasar.dev
MIT License
392 stars 54 forks source link

Support changing and configuring the port number arRPC uses client and server side #84

Open HunterPvP013 opened 2 months ago

HunterPvP013 commented 2 months ago

The request

Add a configuration option on the client and server side, to change which port they communicate on, in the event that other software uses that port already on the end user's machine.

But why though? - The story:

I use a Steam Deck as a daily driver pc, and I have Nobara Linux Steam Deck edition installed on it. I have working Steam Deck Mode, with Decky Loader installed. However, there's a conflict between decky loader and arRPC for used ports, as both need port 1337. Decky loader doesn't have any immediate setting, to change which ports it's using - in fact its readme just tells you to remove any programs using any of the ports that it needs, evidenced by some other's having to give up using Syncthing or they would have to have its port changed, when they also wanted to use Decky loader. I was able to easily change the port number in bridge.js on the server side, from where it functioned normally - started up, and my test game (Genshin) was detected. And although the client couldn't connect, I figured if the port on the plugin's side could be changed, that would most likely get it to work. Unless there's something else, that makes it necessary to use a leet port, I don't see how this feature is a trouble maker.

5310 commented 2 months ago

I too am affected by this exact problem, trying to get games to be detected by arRPC on the Deck.

I was specifically trying to do it for the Quest. This is what I did... I ran the arRPC server after editing the hardcoded port. But then I realized I can't do the same to the Vesktop mod trying to connect to 1337. I suppose I could edit the script for vanilla Discord, but instead I turned off Decky Loader temporarily and see if it worked: and it did! The game is detected immediately, and even the Quest icon shows up when I'm streaming... BUT, Quest progress simply won't work. Because that's bugged for Linux on Discord's end :cry: I'm surprised they even mention that in the [FAQ for this Quest](https://support.discord.com/hc/en-us/articles/22908324765591-Genshin-Impact-Quest). Ultimately that's not arRPC's problem.

I too would love to be able to set a custom port for the bridge and client mod!

diamondburned commented 1 month ago

Would an environment variable work for configuring this? Something like ARRPC_BRIDGE_PORT perhaps?