Genvid Forum

Accessing local server from outside machine


#1

Hey all!

I have a local bastion running (with a “services,” “web,” and “unity” job (based on the Unity sample)) which works perfectly when accessing it from the server machine. Attempting to access the server from another machine, however, results in the websocket connection failing - this has been tested both on another computer within the same LAN and a machine outside of the local network.

At first glance, it looks like this is because the server is returning “127.0.0.1” as the service IP within the /api/public/channels/join call - which, obviously, wouldn’t work on anything other than the server machine. I added in a string replacement on the URI parameter of the createGenvidClient() method to replace the IP with the correct external one just to see if the error was on the client-creation side, but the stream still fails.

I was wondering, is there a place where one can set the external IP for a local bastion install so that the various services return the correct IP and, second, are there are any other additional steps one must perform to run a local bastion that is web-accessible?

For complete-ness sake, I have also turned off the firewall completely on the server machine, and I have placed the server machine in the DMZ of my router, so there shouldn’t be a traffic restriction.


#2

Hi Lucas,

Someone from our team will assist you shortly!

Cheers,
Sophie


#3

Hi Lucas,

You need to set some environment variables.

genvid-bastion uninstall

With Windows command prompt. Used export with bash.

set GENVID_DEFAULT_IP=123.123.123.123
set CONSUL_HTTP_ADDR=123.123.123.123
genvid-bastion install

See: https://www.genvidtech.com/doc/SDK-1.12.0/quicktour/cluster.html?highlight=genvid_default_ip#setting-the-local-ip

Henri


#4

Hey Henri -

That does in fact look like the step I was missing - however, upon attempting those lines with the machine’s external IP (which is accessible by the server machine via ping, and if I start a web server on the machine I can access that), the install process seems to fail: https://pastebin.com/raw/J06NKLrd

In that pastebin, I tried:
1.Uninstalling the Genvid bastion
2. Setting the IP environmental values
3. Installing Genvid bastion (errors)
4. Uninstalling the Genvid bastion
5. Unsetting the IP environmental values
6. Installing Genvid bastion (success)
7. Uninstalling the Genvid bastion
8. Setting the IP environmental values again
9. Installing Genvid bastion (errors)

I tried this process a couple more times with the same results, and also tried restarting the machine with the same results. I also tried using the machine’s LAN IP, in case it was something to do with the network routing that was messing it up, but I had the same experience.


#5

Hi Lucas,

It seems that there is a small error in our documentation. I will create a task to fix it.

For now, you can do the following steps.

1: genvid-bastion uninstall -c
2: set GENVID_DEFAULT_IP=96.39.231.243
3: set CONSUL_HTTP_ADDR=96.39.231.243:8500
4: genvid-bastion install -m -l -u

The “-c” in the first step is to clean the consul configuration. It is a mendatory step for it to work.

I will make sure that this is fixed for our future releases.

Hoping that this helps you

Henri