jishi / node-sonos-web-controller

A web based controller for Sonos utilizing web sockets for a native look and feel
MIT License
248 stars 45 forks source link

Running on relative URL #3

Closed dereulenspiegel closed 10 years ago

dereulenspiegel commented 10 years ago

It should be possible to run this app on a relative URL to easily put a reverse proxy in front of it. Would be awesome.

jishi commented 10 years ago

Hm, the main index.html should handle a relative url just fine, but you probably need to proxy /socket.io/ as well directly to node. The proxy should also handle WebSockets (latest nginx should handle it) to get the full experience.

You could also move the content of static into a subfolder under static if you don't want to rewrite the urls when proxying.

jishi commented 10 years ago

Need a concrete example.

dereulenspiegel commented 10 years ago

A concrete example would for example be a configuration option like 'http-uri' which the user can specify. If you set it to /sonos you should just be able to redirect everything from http://your-reverse.proxy/sonos to the host running the web controller. This is very common with other applications and makes having multiple services on a single machine (or behind a single reverse proxy) much easier.

jishi commented 10 years ago

yeah, I get that, but why can't you forward anything hitting the proxy at /sonos to the host and rewrite it to /? If all images/css/scripts use relative urls it should be pretty straight forward IMO...?