RiftCat / vridge-api

VRidge API is a way to read and write all head and motion controller tracking data used by VRidge.
https://riftcat.com/vridge
MIT License
53 stars 15 forks source link

API connections fails when used from remote address (outside localhost) #6

Closed balukin closed 6 years ago

balukin commented 7 years ago

Effect: Remote API connections fail. Only localhost connections work properly.

Problem source: API server binds to localhost instead of all available IP addresses.

Resolution: Workaround for development purposes will be published here on Tuesday. Proper publicly available fix will follow later in June. Contact us if you need it released faster (for example, if you have product release relying on remote API coming soon).

mungewell commented 7 years ago

Not dealing with remote connections, but early access to "HDMI/no-phone-needed" would really help my pyPSVR project development.

balukin commented 7 years ago

@mungewell This will be released with 2.0 update which will be available for public testing this summer.

balukin commented 7 years ago

Workaround: Create a .bat file next to Riftcat.exe with a following line:

start Riftcat.exe -updatessource "https://riftcat.blob.core.windows.net/updates/apiNetworkFix/feed.xml"

You will need to launch the file twice and continue using the .bat file to keep it patched to the hotfixed version.

Then alter connection scripts to connect to data endpoint (headtracking, controller, broadcast) by known IP address of the server instead of the address dispatched by control service. In the hotfixed version, control service will return *:<port>, for example *:38221 instead of localhost:<port>.

You can ignore the EndpointAddress field completely or replace * with a known IP address of PC that is running VRidge.

As an example, you would need to alter this line:

// Initialize the proxy
headTrackingProxy = new HeadTrackingProxy(response.EndpointAddress, false);

change it to

// Initialize the proxy
headTrackingProxy = new HeadTrackingProxy(response.EndpointAddress.Replace("*", remoteServerIP),
 false);

This is a temporary workaround and v3 will most likely be incompatible with it (* won't be returned in EndpointAddress string). Use it only if you need it fixed immediately for a presentation or some event.

balukin commented 7 years ago

This workaround (a bit altered because we didn't want to break backwards compatibility) is included in latest beta update (1.4.1).

EndpointAddress still contains localhost:port but you can replace "localhost" on client side with actual IP address of the server. Server listens on all available IP addresses now.

balukin commented 6 years ago

Server now returns port only in endpoint response. Caller should now use remote IP address + given port to connect to data.