Ticket #113 (assigned enhancement)

Opened 15 months ago

Last modified 5 months ago

Orbited needs base URL

Reported by: bug Owned by: desmaj
Priority: major Milestone: Orbited 0.7.11
Component: Orbited JavaScript Version: Orbited 0.7.10
Keywords: proxy Cc:

Description

I am trying to proxy Orbited through Nginx, with Nginx set to forward /orbited on port 80 to / on port 8000 (Orbited).

Now, the problem is that the Orbited script has no way to assign a path prefix. Autodetect is not important to me, but this would be very useful.

Change History

Changed 15 months ago by bug

(as a property, I mean)

As far as I can see it only requires adding the path prefix before the static html files (two of them) as well as in the URL constructed out of /tcp.

Changed 15 months ago by bug

By the way, since /tcp is used, Nginx proxies assuming it to be a directory. Maybe it could go in documentation somewhere, but the general settings to get it working are:

	  location /Orbited/static/ {
		proxy_pass http://127.0.0.1:8000/static/;
	  }

	  location /Orbited/tcp {
		proxy_pass http://127.0.0.1:8000/tcp;
		proxy_buffering off;
		tcp_nodelay on;
	  }

Anyway, the changes to add a pathPrefix property are something along the lines of

+ Orbited.settings.pathPrefix = '';

- ifUrl.path = '/static/xsdClose.html';
+ ifUrl.path = Orbited.settings.pathPrefix + '/static/xsdClose.html';

- var sessionUrl = new Orbited.URL('/tcp');
+ var sessionUrl = new Orbited.URL(Orbited.settings.pathPrefix + '/tcp');

- bridgeUrl.path = '/static/xsdrBridge.html';
+ bridgeUrl.path = Orbited.settings.pathPrefix + '/static/xsdrBridge.html';

Works with Firefox, hopefully I haven't left out any places that a path is needed.

Changed 15 months ago by bug

Speaking of, for Nginx, make sure to add 'access_log off;' for the /tcp bit. I just found out it makes a rather large log file otherwise. :)

Changed 5 months ago by desmaj

  • owner set to desmaj
  • status changed from new to assigned
  • version changed from Orbited 0.7.0 to Orbited 0.7.10

Changed 5 months ago by desmaj

  • milestone set to Orbited 0.7.11
Note: See TracTickets for help on using tickets.