WebSocket server that connects to SSH Servers and provides an socket based SSH Interface to SSH Servers. Can be used by Web Based Terminal Renderers like xterm.js.
Run the following command to build the image
npm run build
Run the following command to push to docker repository
npm run push
NOTE: Push only works for people who know the password or have access to PAT.
- Requirements:
- Docker needs to be installed.
Here are the steps to run locally:
-
Create the test ssh container. If you need to build the container hit:
npm run tscbuildThis command will build the docker image. Once the image is built, hit:
npm run tscrunThis will build the container, run it on
0.0.0.0:2223. You can now ssh into test ubuntu ssh server by hitting:ssh ubuntu@localhost -p 2223However, for the ssh socket, we need the internal ip address. So to get the internal ip address, run:
npm run tscechoipThis will give you an internal ip address. Note it down.
-
Now we need the container for
socket-ssh. Here's how to do that: Build if, the image is not built yet.npm run buildPush if, the built image is not pushed yet.
npm run pushFinally, run the docker container.
npm run dockerrun -
Now we need to run the test client. Create a virtualenv and install flask.
$ mkvirtualenv socket-ssh $ pip install flaskNow use the ip address you copied, and paste it in
test_client/templates/index.htmlin this line.var dataToSend = { event: 'ssh_connect', // Event name or identifier ssh_hash: 'asdf', ssh_host: '<paste ip here>', ssh_port: 22, ssh_username: 'ubuntu', ssh_password: '1234' };Now run the test client.
python test_client/test_client_server.pyThis will run our test_client on
0.0.0.0:8375. Open the browser and type0.0.0.0:8375to view the client.
- Scaling websockets.
- Securing websockets with SSL.
- Securing websockets endpoint with AUTH.
- Deploying locally for test.
- Deploying on k8s