vrchat-community / vrc-oscquery-lib

OSCQuery library in .NET
MIT License
49 stars 9 forks source link

localhost only http binding ? #27

Open Romaxx opened 1 year ago

Romaxx commented 1 year ago

Hello, first, thank you for accepting me in this private beta version. In order to use OSC with an external device (because I want to create a mobile app, mdns helping), it could be interesting to bind http server interface to 0.0.0.0 and not only to localhost (without any command line options). Could be pretty useful with PC and Quest devices. Thanks

momo-the-monster commented 1 year ago

Thanks for the suggestion, @Romaxx. When I attempted this initially, I found that binding to 0.0.0.0 on my machine required administrative privileges and...I think there was another issue that I now forget. I'd be open to this if there's a safe way to do it.

Romaxx commented 1 year ago

@momo-the-monster thanks for the reply, have you tried with LAN/WAN interface ? is it planned to work with Quest (with some android authorizations), strange that UDP socket can bind without permissions whereas TCP (http) can't.

momo-the-monster commented 1 year ago

Unfortunately, the issue is with the HttpListener class we're using. PR #29 lets you specify the port, but Windows will give an error unless you've messed with your security settings.

As far as I can tell, we'd need to switch to another http serving class (which will add extra dependencies) in order to enable this for Windows. The good news is that Android can bind to 0.0.0.0 in my tests.

rrazgriz commented 1 year ago

Would like to bump this issue - it's especially important for implementing OSCQuery on standalone devices (where it really shines), especially standalone OSC trackers like Mocopi or Slime.

This limitation should probably be detailed in the Readme, especially for non-VRC users that are more likely to be operating services over the network.