server icon indicating copy to clipboard operation
server copied to clipboard

Reverse proxying on a single port

Open JamesCarpenter opened this issue 9 years ago • 7 comments

Hi there,

First off - great work on Ulterius, it looks fantastic so far.

Secondly, I wonder if you can help? I'm trying to reverse proxy Ulterius on a single port so that I can have all traffic run over 80 for ease of access from restricted networks (eventually I'll use 443 and HTTPS/WSS but for now I'm using 80 to simplify the PoC).

I can see that this should be possible (using the API endpoints /api /webcam etc) and I have the web portion and api running successfully just by entering port 80 at the connection dialogue, but I can't find a way to point the client to a specific port for webcam, screen sharing, etc. I saw in settings that you can choose a port for these, but the setting is server-side which is obviously not what I'm trying to achieve.

Is there a way I can get the client to point to those endpoints on a specific port (e.g. point all to port 80) and have them forward to the correct ports on the server using the reverse proxy?

Below is a copy of my vhost setup to clarify what I mean:

<VirtualHost *:80>

    ServerAdmin <redacted>
    DocumentRoot /var/www/html
    ServerName <redacted>
  ProxyRequests Off
  ProxyVia Off
    <Proxy *>
     Order deny,allow
     Allow from all
    </Proxy>

ProxyPass /api ws://10.0.0.5:22007/
ProxyPassReverse /api ws://10.0.0.5:22007/

ProxyPass /webcam ws://10.0.0.5:22010/
ProxyPassReverse /webcam ws://10.0.0.5:22010/

ProxyPass /terminal ws://10.0.0.5:22008/
ProxyPassReverse /terminal ws://10.0.0.5:22008/

ProxyPass /screenshare ws://10.0.0.5:22009/
ProxyPassReverse /screenshare ws://10.0.0.5:22009/

ProxyPass / http://10.0.0.5:22006/
ProxyPassReverse / http://10.0.0.5:22006/

</VirtualHost>

JamesCarpenter avatar Oct 12 '16 23:10 JamesCarpenter

Hi James,

The client request a list of ports from the server (located in your config) which is where it sends client request. As of now there is no setting to override the server ports, however you could edit the client fairly easily to do this.

We can look into client side port overrides later this week.

You can find a reverse proxy in nginix example here

https://blog.ulterius.io/ulterius-progress-report-august-2016/

On Wednesday, October 12, 2016, JamesCarpenter [email protected] wrote:

Hi there,

First off - great work on Ulterius, it looks fantastic so far.

Secondly, I wonder if you can help? I'm trying to reverse proxy Ulterius on a single port so that I can have all traffic run over 80 for ease of access from restricted networks (eventually I'll use 443 and HTTPS/WSS but for now I'm using 80 to simplify the PoC).

I can see that this should be possible (using the API endpoints /api /webcam etc) and I have the web portion and api running successfully just by entering port 80 at the connection dialogue, but I can't find a way to point the client to a specific port for webcam, screen sharing, etc. I saw in settings that you can choose a port for these, but the setting is server-side which is obviously not what I'm trying to achieve.

Is there a way I can get the client to point to those endpoints on a specific port (e.g. point all to port 80) and have them forward to the correct ports on the server using the reverse proxy?

Below is a copy of my vhost setup to clarify what I mean:

ServerAdmin DocumentRoot /var/www/html ServerName

ProxyRequests Off ProxyVia Off

Order deny,allow Allow from all

ProxyPass /api ws://10.0.0.5:22007/ ProxyPassReverse /api ws://10.0.0.5:22007/

ProxyPass /webcam ws://10.0.0.5:22010/ ProxyPassReverse /webcam ws://10.0.0.5:22010/

ProxyPass /terminal ws://10.0.0.5:22008/ ProxyPassReverse /terminal ws://10.0.0.5:22008/

ProxyPass /screenshare ws://10.0.0.5:22009/ ProxyPassReverse /screenshare ws://10.0.0.5:22009/

ProxyPass / http://10.0.0.5:22006/ ProxyPassReverse / http://10.0.0.5:22006/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Ulterius/server/issues/51, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPKtY5dV2_lYOKjhQMTPCz2ELQMnLh_ks5qzW5JgaJpZM4KVVMA .

andrewmd5 avatar Oct 13 '16 00:10 andrewmd5

Hi - thanks for the swift reply! I did have a look at trying to edit the client, but I'll be honest it looks like it's beyond my limited programming abilities.

If you could point me in the right direction (which file/function) I'll have another crack but no worries if not.

Thanks again

P.s. I saw the reverse proxy example - it was handy, thanks!

JamesCarpenter avatar Oct 13 '16 00:10 JamesCarpenter

Update: I found that by just changing "this.port" in the minified bundle.js to 80 I was able to make it work :)

JamesCarpenter avatar Oct 13 '16 01:10 JamesCarpenter

Thanks James, this actually just made me realize something about the overall design of Ulterius and in the future all logic is possibility going to go through a single port of 22007 (web will still be on 22006)

On Wednesday, October 12, 2016, JamesCarpenter [email protected] wrote:

Update: I found that by just changing "this.port" in the minified bundle.js to 80 I was able to make it work :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Ulterius/server/issues/51#issuecomment-253387141, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPKtRcXzLx5_8PaEAeaGV8pm3NEoH5Eks5qzYs4gaJpZM4KVVMA .

andrewmd5 avatar Oct 13 '16 20:10 andrewmd5

Hi guys, I had this working great, but the server has now updated and I'm no longer able to find the bundle.js which I was able to edit last time to fix the problem I was having... Any ideas?

JamesCarpenter avatar Nov 09 '16 02:11 JamesCarpenter

Hi @JamesCarpenter

IT is located in system32 as Ulterius runs as a service now

C:\Windows\System32\config\systemprofile

andrewmd5 avatar Nov 09 '16 02:11 andrewmd5

Makes sense - thanks very much!

JamesCarpenter avatar Nov 09 '16 03:11 JamesCarpenter