{"id":21007902,"url":"https://github.com/lflxp/lflxp-tty","last_synced_at":"2026-02-16T06:33:25.993Z","repository":{"id":57519446,"uuid":"249364466","full_name":"lflxp/lflxp-tty","owner":"lflxp","description":"Browser sharing terminal","archived":false,"fork":false,"pushed_at":"2025-03-09T16:02:43.000Z","size":4310,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T13:48:18.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lflxp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-03-23T07:36:24.000Z","updated_at":"2025-03-09T16:02:47.000Z","dependencies_parsed_at":"2024-11-19T09:10:32.977Z","dependency_job_id":"e6a71d89-5512-4522-b9d1-17f14067fa2f","html_url":"https://github.com/lflxp/lflxp-tty","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/lflxp/lflxp-tty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Flflxp-tty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Flflxp-tty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Flflxp-tty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Flflxp-tty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lflxp","download_url":"https://codeload.github.com/lflxp/lflxp-tty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Flflxp-tty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29501915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T05:57:17.024Z","status":"ssl_error","status_checked_at":"2026-02-16T05:56:49.929Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T09:10:30.388Z","updated_at":"2026-02-16T06:33:25.979Z","avatar_url":"https://github.com/lflxp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Browser sharing terminal\n\nTTY function module provides terminal tool based on Web, and realizes full duplex communication mechanism of input and output of remote terminal through websocket.\n\n\n![](https://github.com/lflxp/lflxp-tty/blob/master/asset/tty.png)\n![](https://github.com/lflxp/lflxp-tty/blob/master/asset/ttyadmin.png)\n\n# Requirements\n\n* go get -u github.com/jteeuwen/go-bindata/...\n* go get -u github.com/elazarl/go-bindata-assetfs/...\n\n# Install\n\n```\ngit clone https://github.com/lflxp/lflxp-tty\ncd lflxp-tty\nmake install\nlflxp-tty -h\n```\n\n`For Coder Demo`\n\n\u003e cmd/main.go\n\n```go\n...\nimport \"github.com/lflxp/lflxp-tty/pkg\"\n\nfunc main() {\n\ttty := pkg.Tty{\n\t\tEnableTLS:      enableTLS,\n\t\tCrtPath:        crtPath,\n\t\tKeyPath:        keyPath,\n\t\tIsProf:         isProf,\n\t\tIsXsrf:         isXsrf,\n\t\tIsAudit:        isAudit,\n\t\tIsPermitWrite:  isPermitWrite,\n\t\tMaxConnections: MaxConnections,\n\t\tIsReconnect:    isReconnect,\n\t\tIsDebug:        isDebug,\n\t\tUsername:       username,\n\t\tPassword:       password,\n\t\tPort:           port,\n\t\tHost:           host,\n\t\tCmds:           flag.Args(),\n\t}\n\n\terr := tty.Execute()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n# Running\n\n`Format`\n\n```bash\n➜  lflxp-tty git:(master) ✗ ./lflxp-tty -h                                                                                       \nUsage of ./lflxp-tty:\n  -H string\n        http bind host (default \"0.0.0.0\")\n  -P string\n        http bind port (default \"8080\")\n  -a    Open audit or not\n  -c string\n        *.crt file path (default \"./server.crt\")\n  -d    debug log mode\n  -f    Whether to enable pprof performance analysis\n  -graceful\n        listen on open fd (after forking)\n  -k string\n        *.key file path (default \"./server.key\")\n  -m int\n        maximum connection\n  -p string\n        password\n  -r    auto reconnect\n  -socketorder string\n        previous initialization order - used when more than one listener was started\n  -t    Open HTTPS or not\n  -u string\n        username\n  -w    Whether to turn on write mode\n  -x    Whether to turn on xsrf, which is on by default\n```\n\n* Read Only Command\n    \u003e ./lflxp-tty top\n* ReadWrite Mode\n    \u003e ./lflxp-tty -w bash\n* Full Options\n    \u003e ./lflxp-tty  -w -a -t -c ./server.crt -k ./server.key -m 10 -u admin -p admin -f -d 'docker run --rm -it -p 6379:7379 redis'\n\n# Function point\n\n* Independent binary operation, no other dependence\n* Provide security audit\n    * Access statistics\n    * Command statistics\n* Provide secure HTTPS connection\n* Provide xsrf Security Assistance\n* Provide performance analysis\n    * pprof\n* Provide interface monitoring\n    * Prometheus\n* Provide reconnection mechanism\n* Provide current limiting mechanism\n* Cross platform support\n* Provide background web visual management\n    * View access records\n    * View operation record\n    * View monitoring records (Prometheus metrics)\n    * Full screen display\n* Provide basicauth mode\n* Provide host: port binding mode\n* Provide debug log mode\n* Support multiple remote modes\n    * Read / write mode\n    * Bash mode (default)\n    * Custom mode\n        * TMUX\n        * docker run --rm -it -p 6379:6379 redis\n        * Top\n\n# Technology stack\n\n* xterm.js\n* pty/tty\n* backend\n    * golang\n    * websocket\n    * Prometheus\n    * gin\n    * restful\n* front-end\n    * HTML\n    * JavaScript\n    * Vue\n    * element-ui\n\n## Environment settings\n\nWhen using 'systemctl' for service deployment, showme will report 'term environment variable not set'. You need to specify the environment variable 'term = xterm-256color' in the service file`\n\n```\nroot@8.8.8.8:/etc/systemd/system# cat showme.service \n[Unit]\nDescription=showme\nAfter=syslog.target\nAfter=network.target\n\n[Service]\n# Modify these two values and uncomment them if you have\n# repos with lots of files and get an HTTP error 500 because\n# of that\n###\n#LimitMEMLOCK=infinity\n#LimitNOFILE=65535\nType=simple\nUser=root\nGroup=root\nWorkingDirectory=/tls\nExecStart=/usr/bin/showme tty -P 9999 -w -a -t -f -m 10 -u $user -p $pwd -c /tls/server.crt -k /tls/server.key\n# ExecReload=/bin/kill -s HUP $MAINPID\nRestart=always\nEnvironment=USER=root HOME=/root TERM=xterm-256color\n\n[Install]\nWantedBy=multi-user.target\n```\n\n## Generate TLS file\n\n```bash\ncd lflxp-tty\n➜  lflxp-tty git:(master) ✗ make crt  \nrm -f cmd/cmd\nrm -f lflxp-tty\nrm -rf tls\nmkdir -p tls\nopenssl genrsa -out tls/server.key 2048\nGenerating RSA private key, 2048 bit long modulus (2 primes)\n....................................................+++++\n.....+++++\ne is 65537 (0x010001)\nopenssl req -nodes -new -key tls/server.key -subj \"/CN=www.lflxp.cn\" -out tls/server.csr\nCan not load /home/xp/.rnd into RNG\n140503399961024:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/home/xp/.rnd\nopenssl x509 -req -sha256 -days 3650 -in tls/server.csr -signkey tls/server.key -out tls/server.crt\nSignature ok\nsubject=CN = www.lflxp.cn\nGetting Private key\n➜  lflxp-tty git:(master) ✗ ls -l tls/\ntotal 12\n-rw-rw-r-- 1 xp xp 1001 3月  23 17:11 server.crt\n-rw-rw-r-- 1 xp xp  895 3月  23 17:11 server.csr\n-rw------- 1 xp xp 1675 3月  23 17:11 server.key\n```\n\n# TODO\n\n1. 自定义初始化命令通过http参数传递\n2. 提供gin func插件","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flflxp%2Flflxp-tty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flflxp%2Flflxp-tty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flflxp%2Flflxp-tty/lists"}