drewdeponte / tmuxme_client

Offical repo has moved to
http://github.com/codebreakdown/tmuxme_client
MIT License
2 stars 3 forks source link

Add support for other forwards via .tmux.yml or similar config #1

Open drewdeponte opened 10 years ago

drewdeponte commented 10 years ago

We should have the tmuxme client and service be able to support other port forwards. For example lets say the project that the user is going to be pairing on is a Rails web application. It is likely that the pair hosting the session will also want to share their development instance of "rails server" with the person they are pairing with. There could be other things as well. Therefore, we should generically support a project specific config file that is hidden at the root of the project which will all the user to configure port forwards for that project.

For the above described scenario the .tmuxme.yml file may look something like the following.

local_forwards:
  - 3000

When the tmuxme client sets up the session and the forwards it should include the randomly selected high numbered port that maps to 3000 so that the users that are invited to the pairing session know about it. Also, it should be output to the command line so that the hosting user can share it using out of band communication mechanisms.

One thing to think about is that it may make more sense to have the configuration file be more specific so that it knows that the forward is for a url. That way it can present an actual URL to the invited users and to the hosting user.

If we were going to do this it would be ideal to know the protocol (http | https, maybe others), and the path, because the domain, localhost:3000, portion would be replaced with tmux.me:<randomly selected high port number>.

So basically http://localhost:3000/some/path would be converted to http://tmux.me:53453/some/path.

The config might look like this:

local_web_tunnels:
    - protocol: http
      port: 3000
      path: /some/path

    - protocol: https
      port: 8080
      path: /

This would allow us to generate the following urls:

http://tmux.me:59342/some/path
https://tmux.me:24234/
drewdeponte commented 10 years ago

Examples of tools that do this already are https://ngrok.com/ and http://progrium.com/localtunnel/. It might be valuable to look at how they communicate these types of things to the user.