jiangmiao / wsterm Goto Github PK
View Code? Open in Web Editor NEWWebSocket Terminal - run commands through websocket
License: MIT License
WebSocket Terminal - run commands through websocket
License: MIT License
Websocket Terminal Run commands through websocket Requirements golang - compile the code expect - handle processes bash - run the command Installation go get -u -v github.com/jiangmiao/wsterm/wsterm Usage $ wsterm 2018/03/11 19:39:28 websocket url ws://localhost:9300/ws # use https://github.com/hashrocket/ws send test requests # general echo $ ws ws://localhost:9300/ws > {"type":"exec", "data":"echo hello world"} < {"type":"stdout","data":"hello world\r\n"} < {"type":"exit","data":{"code":0,"message":""}} # stderr handle $ ws ws://localhost:9300/ws > {"type":"exec","data":"curl"} < {"type":"stderr","data":"curl: try 'curl -"} < {"type":"stderr","data":"-help' or 'curl --manual' for more information\n"} < {"type":"exit","data":{"code":2,"message":"exit status 2"}} # stop process $ ws ws://localhost:9300/ws > {"type":"exec", "data":"sudo ping 127.0.0.1"} < {"type":"stdout","data":"PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.\r\n64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.038 ms\r\n"} < {"type":"stdout","data":"64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.044 ms\r\n"} < {"type":"stdout","data":"64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.043 ms\r\n"} # send stop message > {"type":"stop"} < {"type":"exit","data":{"code":130,"message":"exit status 130"}} Request Messages {"type": "exec", "data": "command"} {"type": "stop"} Response Messages {"type": "stdout", "data": "stdout text"} {"type": "stderr", "data": "stderr text"} {"type": "exit", "data": {"code": 0, "message", "error message"}} License MIT
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.