Closed NV closed 13 years ago
Forward port via ssh:
ssh -L35729:localhost:35729 my_remote_server
Don't need any modification in LR.
man ssh
:
-L [bind_address:]port:host:hostport
Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. This works by allocating
a socket to listen to port on the local side, optionally bound to the specified bind_address. Whenever a connection is made to this port, the con-
nection is forwarded over the secure channel, and a connection is made to host port hostport from the remote machine. Port forwardings can also be
specified in the configuration file. IPv6 addresses can be specified with an alternative syntax: [bind_address/]port/host/hostport or by enclosing
the address in square brackets. Only the superuser can forward privileged ports. By default, the local port is bound in accordance with the
GatewayPorts setting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of
"localhost'' indicates that the listening port be bound for local use only, while an empty address or '*' indicates that the port should be avail-
able from all interfaces.
Would be great to have a shortcut like
➤ livereload --remote my_remote_server:~/example.com/www
It should:
ssh -L35729:localhost:35729 my_remote_server
locally (that's easy)livereload ~/example.com/www
on the remote server (is it even possible?)Turns out it's simple as
ssh -L35729:localhost:35729 my_remote_server 'livereload ~/example.com/www'
The correct solution is to provide a way to configure the server address. SSH tunnels are not sufficient as a workaround since they take extra work to setup, maintain on reboot etc. When your Chrome is on Windows, it's even more complicated to set up.
Just make host and port configurable, just like every other networked application in the world.
Wrote a patch that makes host and port configurable in Safari and Chrome:
https://github.com/justmoon/livereload/commit/6dcca4d55043d72f776d8697f3df459a335acb60
Thanks for the patch! I'm looking into it.
Landed in 00ff8a05e1a748c895b55f7da59e4e0cc2803186. I've made a quick testing and haven't found any problems with it.
I do most of my day job on remote server via ssh. I want to use livereload there as well as on my local machine.
We need
localhost
(not a big deal)