Skip to content

bottlerocketlabs/pair

Repository files navigation

pair

A tool for sharing your terminal tmux session with others across the interwebs

Useful for pair programming with terminal based editors (vim/emacs)

2 parts

  • server for sharing webrtc session descriptions (instance hosted on heroku)
  • client for hosting/joining a session

based on work by https://github.com/maxmcd/webtty and https://github.com/nwtgck/go-piping-server

103407652-537ef800-4b57-11eb-8b47-3e6ae66f70c3.mp4

Install

Should probably work within a WSL2 terminal on Windows 10 also

brew install tmux bottlerocketlabs/apps/pair

Manually

Download pair binaries from releases and put on path, you need to also install tmux for your platform (apt-get etc)

How-To

  • client host must be started in a tmux session
  • client guest must not be started in a tmux session

Start by hosting a session within tmux:

# host
$ pair

Share this command with your guest:
  pair http://<some url>

Invite a guest by quickly supplying the command output above

# guest
$ pair http://<url from host>

Testing/Development

Optionally setup a simple (insecure) local testing server and use it:

$ pair-server-simple -v &
$ pair -v -sdp http://localhost

Setup local testing server with mkcert:

mkcert -install
mkdir -p certs
cd certs
mkcert localhost.dev
mkcert localhost
mkcert <someotherdomain>
cd ..
# append '127.0.0.1 localhost.dev <someotherdomain>' to /etc/hosts file
pair-server -v -domain localhost.dev

Run server in production with acme:

# ensure chosen domain is registered and can access public server on ports 80 and 443
mkdir -p certs
pair-server -v -domain <chosen-domain>

TODO

  • add more tests
  • run tmux and host pair within a development docker container to restrict access