Ports,ports,ports..

Victor Palau victor.palau at canonical.com
Mon Oct 10 17:03:49 UTC 2016


Hi,

As more snaps are published, the more I want to install on my PC,
device,... Many of them expose some cool services in
localhost:[randomport], and I find it that it is getting hard to remember
them all.

Building on an existing tinyproxy snap, I have published (amd64 only at the
mo) a local reverse-proxy snap called: local-proxy

sudo snap install local-proxy

This allows you to map a path to your app: http://localhost/yourapp/ -->
http://localhost:[highport]

It comes with a default fwd for snapweb from /snapweb/ to localhost:4200
It also comes with some utility commands like add,delete and print.

The local-proxy defaults to 8080, but you can change it by running:
local-proxy.port [your port]

and then restarting the service:
sudo systemctl restart snap.local-proxy.tinyproxy

However, there is still a problem that some of snaps assume that they can
take control of a popular port (such as 80) without facilities to change
it.
Also some do not take kindly to be proxy-ed (like snapweb) - although
tinyproxy has a great "magic cookie" feature that I have enabled by default
to work around this.

Overall, seems like it would be good practice that if a snap publishes a
service to a port, that:

   - the port can be easily changed
   - the snap can be updated told that it will be proxy-ed, and work well

A local reverse proxy feels like this is just a quick fix to a bigger
problem... any long term fix suggestions?

Thanks

Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20161010/9bb3a6d1/attachment.html>


More information about the Snapcraft mailing list