Giter Club home page Giter Club logo

rttys's Introduction

rttys(中文)

license PRs Welcome Issue Welcome Release Version Build Status

This is the server program of rtty

Authorization(optional)

Token

Generate a token

$ rttys token
Please set a password:******
Your token is: 34762d07637276694b938d23f10d7164

Use token

$ rttys run -t 34762d07637276694b938d23f10d7164

mTLS

You can enable mTLS by specifying device CA storage (valid file) in config file or from CLI (variable ssl-cacert). Device(s) without valid CA in storage will be disconnected in TLS handshake.

Database Preparation

Sqlite

s#qlite://rttys.db

MySql or Mariadb

mysql://rttys:rttys@tcp(localhost)/rttys

On database instance, login to database console as root:

mysql -u root -p

Create database user which will be used by Rttys, authenticated by password. This example uses 'rttys' as password. Please use a secure password for your instance.

CREATE USER 'rttys' IDENTIFIED BY 'rttys';

Create database with UTF-8 charset and collation. Make sure to use utf8mb4 charset instead of utf8 as the former supports all Unicode characters (including emojis) beyond Basic Multilingual Plane. Also, collation chosen depending on your expected content. When in doubt, use either unicode_ci or general_ci.

CREATE DATABASE rttys CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';

Grant all privileges on the database to database user created above.

GRANT ALL PRIVILEGES ON rttys.* TO 'rttys';
FLUSH PRIVILEGES;

Quit from database console by exit.

Docker

sudo docker run -it -p 5912:5912 -p 5913:5913 zhaojh329/rttys:latest

Contributing

If you would like to help making rttys better, see the CONTRIBUTING.md file.

rttys's People

Contributors

akgnah avatar dependabot[bot] avatar docooler avatar emanuelr93 avatar jiri-novotny avatar ling5821 avatar lishimeng avatar richard611 avatar sgaynetdinov avatar tamisoft avatar zhaojh329 avatar zsichen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rttys's Issues

rttys 删除了会话

2020-09-07T06:35:11Z |INFO| broker.go:113 |New session: 91008550
2020-09-07T06:35:15Z |INFO| device.go:118 |Device '' closed
2020-09-07T06:35:24Z |ERROR| device.go:97 |Inactive device in long time, now kill it:
2020-09-07T06:35:25Z |ERROR| device.go:163 |bufio: buffer full
2020-09-07T06:35:25Z |INFO| device.go:118 |Device '' closed
2020-09-07T06:35:30Z |INFO| device.go:118 |Device '' closed
2020-09-07T06:35:39Z |ERROR| device.go:97 |Inactive device in long time, now kill it:
2020-09-07T06:35:40Z |2020-09-07T06:35:40Z |ERROR| INFO| device.go:118 |Device '' closed
device.go:163 |bufio: buffer full
2020-09-07T06:35:45Z |INFO| device.go:118 |Device '' closed
2020-09-07T06:35:54Z |ERROR| device.go:97 |Inactive device in long time, now kill it:
2020-09-07T06:35:55Z |2020-09-07T06:35:55Z |INFO| ERROR| device.go:118 |Device '' closed
device.go:163 |bufio: buffer full
2020-09-07T06:36:00Z |INFO| device.go:118 |Device '' closed
2020-09-07T06:36:09Z |ERROR| device.go:97 |Inactive device in long time, now kill it:
2020-09-07T06:36:10Z |ERROR| device.go:163 |bufio: buffer full
2020-09-07T06:36:10Z |INFO| device.go:118 |Device '' closed
2020-09-07T06:36:15Z |INFO| device.go:118 |Device '' closed
2020-09-07T06:36:15Z |INFO| broker.go:105 |Delete session: 91008550

我想要设置会话保持长一点时间。我该如何做?

添加nginx代理不能添加工程名

nginx配置如下

server {
  listen       80;
  server_name  localhost;
  location /rttys/ {
    proxy_pass http://127.0.0.1:5912/;
    proxy_http_version 1.1;
    proxy_read_timeout 300;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-PORT $remote_port;
  }
}

通过上面的配置自以为可以给我rttys添加一个工程名rttys,但是失败
使用curl测试
返回的location是/?t=1568125811,不包含工程名

curl -v "http://192.168.99.214/rttys/"
* About to connect() to 192.168.99.214 port 80 (#0)
*   Trying 192.168.99.214...
* Connected to 192.168.99.214 (192.168.99.214) port 80 (#0)
> GET /rttys/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 192.168.99.214
> Accept: */*
> 
< HTTP/1.1 302 Found
< Server: nginx
< Date: Tue, 10 Sep 2019 14:30:11 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 37
< Connection: keep-alive
< Location: /?t=1568125811
< 
<a href="/?t=1568125811">Found</a>.

* Connection #0 to host 192.168.99.214 left intact

with the latest client and server, websocket failed to connect.

server log:

INFO[0000] Go Version: go1.11.5                         
INFO[0000] Go OS/Arch: linux/amd64                      
INFO[0000] Rttys Version: 2.10.3                        
INFO[0000] Git Commit: 27abde3                          
INFO[0000] Build Time: 2019-08-29T07:24:31+0800         
ERRO[0000] lstat ./rttys.crt: no such file or directory 
ERRO[0000] lstat ./rttys.key: no such file or directory 
INFO[0000] Listen on: :9082 SSL off                     
INFO[0011] New device:My-device-ID                      
INFO[0041] websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header 

client log:

2019/08/28 19:54:16 (main.c:467) libuwsc version 3.3.2
2019/08/28 19:54:16 (main.c:468) rtty version 6.6.1
2019/08/28 19:54:16 (main.c:284) Connect to server succeed

Redirect to file of STDOUT not working

I have tried to start rttys with nohup and output is not redirected to the file /tmp/rttys.log

nohup rttys -conf /data/conf/rttys.conf & > /tmp/rttys.log

It is a logger problem?

panic: runtime error: makeslice: len out of range

描述

服务端的 rttys 总自己结束,并且添加到 systemd 的守护无法正常重启

运行环境

  • 服务端程序 v3.1.3
  • 客户端程序 v7.1.4
  • 服务端操作系统 Linux ecs 4.4.0-151-generic #178-Ubuntu x86_64 GNU/Linux
  • 客户端操作系统 openwrt 14.07

systemd 失败日志

root@ecs:~# systemctl status rttys
● rttys.service - rttys
   Loaded: loaded (/lib/systemd/system/rttys.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-12-03 04:53:31 CST; 7h ago
  Process: 28138 ExecStart=/usr/local/bin/rttys -conf /etc/rttys/rttys.conf (code=exited, status=2)
 Main PID: 28138 (code=exited, status=2)
Dec 03 04:53:31 ecs rttys[28138]: panic: runtime error: makeslice: len out of range
Dec 03 04:53:31 ecs rttys[28138]: goroutine 1319 [running]:
Dec 03 04:53:31 ecs rttys[28138]: main.(*Device).readLoop(0xc00018c2d0)
Dec 03 04:53:31 ecs rttys[28138]:         /home/zjh/go/src/github.com/zhaojh329/rttys/device.go:196 +0x49e
Dec 03 04:53:31 ecs rttys[28138]: created by main.listenDevice
Dec 03 04:53:31 ecs rttys[28138]:         /home/zjh/go/src/github.com/zhaojh329/rttys/device.go:256 +0x3be
Dec 03 04:53:31 ecs systemd[1]: rttys.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 03 04:53:31 ecs systemd[1]: rttys.service: Unit entered failed state.
Dec 03 04:53:31 ecs systemd[1]: rttys.service: Failed with result 'exit-code'.

rttys 部分错误日志

2020-12-02T11:27:22+08:00 |INFO| main.go:79 |Go Version: go1.14
2020-12-02T11:27:22+08:00 |INFO| main.go:80 |Go OS/Arch: linux/amd64
2020-12-02T11:27:22+08:00 |INFO| main.go:82 |Rttys Version: 3.1.3
2020-12-02T11:27:22+08:00 |INFO| main.go:88 |Git Commit: a065f65
2020-12-02T11:27:22+08:00 |INFO| main.go:92 |Build Time: 2020-03-15T20:31:09+0800
2020-12-02T11:27:22+08:00 |INFO| device.go:238 |Listen device on: :5912 SSL off
2020-12-02T11:27:22+08:00 |INFO| http.go:201 |Listen user on: :5913 SSL off
2020-12-02T11:28:17+08:00 |ERROR| device.go:97 |Inactive device in long time, now kill it: XXX
2020-12-02T15:40:20+08:00 |ERROR| device.go:97 |Inactive device in long time, now kill it: XXX
2020-12-02T15:40:21+08:00 |ERROR| broker.go:150 |Not found sid: XXX
2020-12-02T16:02:25+08:00 |ERROR| device.go:97 |Inactive device in long time, now kill it: XXX
2020-12-02T16:07:34+08:00 |ERROR| device.go:97 |Inactive device in long time, now kill it: XXX
2020-12-02T17:05:19+08:00 |ERROR| device.go:154 |read tcp 192.168.0.159:5912->39.XXX.XXX.107:42510: read: connection reset by peer
2020-12-02T20:02:24+08:00 |ERROR| device.go:154 |read tcp 192.168.0.159:5912->192.XXX.XXX.48:6028: read: connection reset by peer
2020-12-02T20:02:28+08:00 |ERROR| device.go:163 |read tcp 192.168.0.159:5912->192.XXX.XXX.48:25480: read: connection reset by peer
2020-12-02T20:02:33+08:00 |ERROR| device.go:97 |Inactive device in long time, now kill it: 
2020-12-02T20:02:34+08:00 |2020-12-02T20:02:34+08:00 |ERROR| device.go:163 |INFO| bufio: buffer full
device.go:118 |Device '' closed
2020-12-02T20:05:16+08:00 |ERROR| device.go:154 |read tcp 192.168.0.159:5912->192.XXX.XXX.48:55394: read: connection reset by peer
2020-12-02T20:05:19+08:00 |ERROR| device.go:163 |read tcp 192.168.0.159:5912->192.XXX.XXX.48:52712: read: connection reset by peer
2020-12-02T20:05:25+08:00 |ERROR| device.go:97 |Inactive device in long time, now kill it: 
2020-12-03T00:28:43+08:00 |ERROR| device.go:154 |read tcp 192.168.0.159:5912->167.XXX.XXX.40:56200: read: connection reset by peer
2020-12-03T00:28:47+08:00 |ERROR| device.go:163 |read tcp 192.168.0.159:5912->167.XXX.XXX.40:51134: read: connection reset by peer
2020-12-03T00:28:50+08:00 |ERROR| device.go:163 |bufio: buffer full
2020-12-03T00:28:59+08:00 |ERROR| device.go:97 |Inactive device in long time, now kill it: 
2020-12-03T02:00:08+08:00 |ERROR| device.go:97 |Inactive device in long time, now kill it: XXX

docker启动,过一会挂掉 makeslice: len out of range

2020-10-29T12:18:32Z |ERRO| device.go:97 |Inactive device in long time, now kill it: ,
2020-10-29T12:18:33Z |INFO| device.go:118 |Device '' closed ,
panic: runtime error: makeslice: len out of range,
,
goroutine 7823 [running]:,
main.(*Device).readLoop(0xc0000d8000),
/home/zjh/go/src/github.com/zhaojh329/rttys/device.go:196 +0x49e,
created by main.listenDevice,
/home/zjh/go/src/github.com/zhaojh329/rttys/device.go:256 +0x3be,

请问root为什么不能登录?

如下:
NanoPi-NEO-Plus2 login: root
Login incorrect

root不能登录,其他账户可以登录,怎样才可以让root登录呢?

登陆终端后tmux命令无法使用

嗨,我发现一个问题,如果在rttys中登陆了终端,如果使用tmux命令,会报错无法打开tmux terminal。
报错如下:
root@workstation:~$ tmux
open terminal failed: missing or unsuitable terminal: unknown

请问下可以修复支持tmux命令么?

can't login

Hi.

This is a nice tool. Fisrt of all, thanks.

I tried 2.5.1 version. Can't login and shows 'Login Fail! username or password wrong.'
version 2.1.1 is OK. I can login without problem.
My environment is CentOS release 6.10 (Final), x86_64.
No failure log is found.
How can I know the what cause this?
Thanks.

Server package for Buildroot

The client package is already available in Buildroot. The server package should also be added to Buildroot.

It would be easy to implement when this patch is merged into Buildroot.

ubuntu系統下服務端websocket多綫程崩潰bug

panic: concurrent write to websocket connection

goroutine 40 [running]:
github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc000075750, 0x10f1001, 0x10f10d0, 0x0, 0x0, 0x438985, 0xca7960)
/home/zjh/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:610 +0x60e
github.com/gorilla/websocket.(*Conn).WriteMessage(0xc0001c06e0, 0x9, 0x10f10d0, 0x0, 0x0, 0x0, 0x0)
/home/zjh/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:763 +0x238
main.(*user).WriteMsg(...)
/home/zjh/rttys/user.go:52
main.(*user).keepAlive(0xc00008ab40)
/home/zjh/rttys/user.go:74 +0x65
created by main.serveUser
/home/zjh/rttys/user.go:119 +0x21b

軟體版本:rttys version 3.3.1
系統版本:Linux 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

修改vue不生效

您好,有个问题请教一下:
我修改html/src/view下的vue文件后,执行./build.sh编译后对vue文件的修改并没有生效。后来发现将html删除掉后竟然也能编译。直接html下npm run build生成html文件,但是感觉好像和./build.sh编译没什么关系。
请教下我想修改vue界面文件,如何编译才能使得这个生效呢?
非常感谢!

Why was Darwin/Mac support removed?

I have a Mackbook and I want to run the server locally so I don't have to pay for a server in the cloud.My servers are local to my network as well as on other Internet accessible networks.

Doesn't Go make it easy to produce different binaries for different platforms?

能否提供docker版镜像

在hub.docker.com中
提供rttys的镜像服务,提供DockerFile

我在ubuntu 16.04下 用golang-go 1.6版无法go get
我对go不熟,能否说明一下编译的环境和版本
详细操作流程。

下面是日志

Generating a 2048 bit RSA private key
......................+++
......+++
writing new private key to 'output/ca.key'

Created CA certificate in output/ca.crt
subject=
commonName = An MQTT broker
organizationName = OwnTracks.org
organizationalUnitName = generate-CA
emailAddress = [email protected]
Warning: the CA key is not encrypted; store it safely!
--- Creating server key and signing request
Generating RSA private key, 2048 bit long modulus
....................................................................................................................................................................................................................................................................................................................................................................+++
................................................+++
e is 65537 (0x10001)
--- Creating and signing server certificate
Signature ok
subject=/CN=rttys/O=OwnTracks.org/OU=generate-CA/emailAddress=[email protected]
Getting CA Private Key
package context: unrecognized import path "context" (import path does not begin with hostname)
package net/http/httptrace: unrecognized import path "net/http/httptrace" (import path does not begin with hostname)
../../go/src/github.com/gorilla/websocket/client.go:9:2: cannot find package "context" in any of:
/usr/lib/go-1.6/src/context (from $GOROOT)
/home/darcy/go/src/context (from $GOPATH)
../../go/src/github.com/gorilla/websocket/client.go:16:2: cannot find package "net/http/httptrace" in any of:
/usr/lib/go-1.6/src/net/http/httptrace (from $GOROOT)
/home/darcy/go/src/net/http/httptrace (from $GOPATH)
rttys-linux-amd64/
rttys-linux-amd64/rttys.crt
rttys-linux-amd64/rttys.key
package context: unrecognized import path "context" (import path does not begin with hostname)
package net/http/httptrace: unrecognized import path "net/http/httptrace" (import path does not begin with hostname)
../../go/src/github.com/gorilla/websocket/client.go:9:2: cannot find package "context" in any of:
/usr/lib/go-1.6/src/context (from $GOROOT)
/home/darcy/go/src/context (from $GOPATH)
../../go/src/github.com/gorilla/websocket/client.go:16:2: cannot find package "net/http/httptrace" in any of:
/usr/lib/go-1.6/src/net/http/httptrace (from $GOROOT)
/home/darcy/go/src/net/http/httptrace (from $GOPATH)
rttys-linux-386/
rttys-linux-386/rttys.crt
rttys-linux-386/rttys.key
package context: unrecognized import path "context" (import path does not begin with hostname)
package net/http/httptrace: unrecognized import path "net/http/httptrace" (import path does not begin with hostname)
../../go/src/github.com/gorilla/websocket/client.go:9:2: cannot find package "context" in any of:
/usr/lib/go-1.6/src/context (from $GOROOT)
/home/darcy/go/src/context (from $GOPATH)
../../go/src/github.com/gorilla/websocket/client.go:16:2: cannot find package "net/http/httptrace" in any of:
/usr/lib/go-1.6/src/net/http/httptrace (from $GOROOT)
/home/darcy/go/src/net/http/httptrace (from $GOPATH)
adding: rttys-windows-amd64/ (stored 0%)
adding: rttys-windows-amd64/rttys.crt (deflated 32%)
adding: rttys-windows-amd64/rttys.key (deflated 23%)
package context: unrecognized import path "context" (import path does not begin with hostname)
package net/http/httptrace: unrecognized import path "net/http/httptrace" (import path does not begin with hostname)
../../go/src/github.com/gorilla/websocket/client.go:9:2: cannot find package "context" in any of:
/usr/lib/go-1.6/src/context (from $GOROOT)
/home/darcy/go/src/context (from $GOPATH)
../../go/src/github.com/gorilla/websocket/client.go:16:2: cannot find package "net/http/httptrace" in any of:
/usr/lib/go-1.6/src/net/http/httptrace (from $GOROOT)
/home/darcy/go/src/net/http/httptrace (from $GOPATH)
adding: rttys-windows-386/ (stored 0%)
adding: rttys-windows-386/rttys.crt (deflated 32%)
adding: rttys-windows-386/rttys.key (deflated 23%)

Prebuilt Armv7h releases

Thank you for releasing your software :) would you mind creating prebuilt releases for armv{5,6,7}h?
I would love to run the server on my ARM device.

请问可以管理多台机器吗

这个貌似只能一台机器部署服务端和客户端管理自身机器,请问可以实现管理多台机器吗?不然的话有推荐的项目吗?
谢谢!

命令可以执行,设备无法连接

命令1
命令2
登陆失败
连接的账号密码是什么,我输的是客户端的用户名和密码,连接失败,但是命令的校验是正确的,客户端的用户名和密码正确才能执行

证书问题

请问,服务端我需要自己生成证书吗?为什么总是提示登陆incorrect

cant access server

only listen ipv6 (test in tencent and ali server)
netstat -anptl | grep 5912 | grep LISTEN
tcp6 0 0 :::5912 :::* LISTEN 7813/rttys

but ok server, like nginx:
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 833/nginx: master p
tcp6 0 0 :::8080 :::* LISTEN 833/nginx: master p

Uncaught ReferenceError: exports is not defined

Hi

  1. git clone https://github.com/zhaojh329/rttys.git
  2. cd ./rttys/html
  3. npm install
  4. npm run serve
  5. open browse - console log
Uncaught ReferenceError: exports is not defined
    at Module.2bcc (overlay.js:4)
    at i (bootstrap:78)
    at Object.<anonymous> (App.vue?4241:1)
    at Object.281a (Rtty.vue:203)
    at i (bootstrap:78)
    at Module.56d7 (Rtty.vue?7e27:2)
    at i (bootstrap:78)
    at Object.0 (bootstrap:151)
    at i (bootstrap:78)
    at n (bootstrap:45)
$ npm --version
6.4.1

$ node --version
v10.15.3

Authorization Required

Hi,

trying it out...

I have rttys running on AWS EC2 instance and the client running on my Linux desktop. Client succeeds in connecting to server but when I go to the web portal it says Authorization Required. As you know on EC2 there is no root by default and login is via ssh using authorized public key or the generated pem key. What username and password am I supposed to put in?

出现文字重复的情况

使用 tailf 查看一个服务的日志之后,在使用vi编辑一个文件就会出现文字重叠

http://kod.online.uairobot.com/index.php?share/file&user=1&sid=yUkdG3iw

REQUEST: Please Add Read Only Mode.

This can be helpful to just view any long running job status and avoid accidenty killing it when viewing over small devices (fat fingers syndrome :))

浏览器不能登录

服务端安装完成后,能正常启动:
pavt@pavt-server:~/tools/rttys-linux-amd64$ sudo ./rttys
[sudo] pavt 的密码:
INFO[0000] Go Version: go1.12.4
INFO[0000] Go OS/Arch: linux/amd64
INFO[0000] Rttys Version: 2.10.3
INFO[0000] Git Commit: 27abde3
INFO[0000] Build Time: 2019-08-13T11:26:31+0800
INFO[0000] Listen on: :5912 SSL on
INFO[0021] New device:star-test
INFO[0043] Died device:star-test

浏览器输入服务器ip后出现下面提示:
Client sent an HTTP request to an HTTPS server.
没有设备列表。

rttys crash with makeslice failed

Environment

OS infor

Ubuntu 18.04 X64

Rttys info

rttys is download in release page as 3.13 version.

Rttys startup information:
2020-07-20T17:30:19+08:00 |INFO| main.go:79 |Go Version: go1.14
2020-07-20T17:30:19+08:00 |INFO| main.go:80 |Go OS/Arch: linux/amd64
2020-07-20T17:30:19+08:00 |INFO| main.go:82 |Rttys Version: 3.1.3
2020-07-20T17:30:19+08:00 |INFO| main.go:88 |Git Commit: a065f65

Crash

Details log:

[GIN] 2020/07/20 - 16:54:41 | 200 |      42.335µs |  180.166.64.115 | GET      /devs

panic: runtime error: makeslice: len out of range
goroutine 62 [running]:
main.(*Device).readLoop(0xc000176090)
        /home/zjh/go/src/github.com/zhaojh329/rttys/device.go:196 +0x49e
created by main.listenDevice
        /home/zjh/go/src/github.com/zhaojh329/rttys/device.go:256 +0x3be
root@VM-0-3-ubuntu:~/SW/rttys-linux-amd64#

len out of range

When rttys server runs for a while, there is a critical error, as shown below.

2020-04-04T02:26:22Z |INFO| device.go:118 |Device '' closed 
2020-04-04T02:26:22Z |ERRO| device.go:163 |bufio: buffer full 
2020-04-04T02:26:31Z |INFO| device.go:118 |Device '' closed 
panic: runtime error: makeslice: len out of range

goroutine 48591 [running]:
main.(*Device).readLoop(0xc0001e0120)
        /home/zjh/work/rttys/device.go:196 +0x49e
created by main.listenDevice
        /home/zjh/work/rttys/device.go:256 +0x3be

Remove check on UID 0

Currently application need to start as Root.
If we specify username and password in config file, start as root it is not necessary.
This is useful for starting server in Kubernetes/Openshift that not allow running as root.

make base_url work for behind nginx proxy

I found something in the sample .conf like: base-url: /
This doens't seem to be used in the http.go code.

I would very much like to be able to make the webui available in a subdirectory (like https://www.example.com/rtty/)
So that I can put it behind my nginx server and integrate it with my other tools.
Same goes for the dev endpoint, if I could also put that behind nginx in a subdirectory, it would be perfect.
I need this, becuase the rttys is running on a VPS with already website running on https.
I require my rtty client to run rtty on port 443 (firewall prevents other ports) instead of 5912
But right now, 443 is already on nginx, and I cannot use it (because I cannot proxy to rttys since it doesn't support a subdirectory)

Regards,
JD

onerror:2: Invalid header

[root@214 ~]# /usr/local/bin/rtty -I '214' -h 'xxxx' -p 1027 -a -v -t xxxx
the logs

2019/09/10 11:49:40 (main.c:462) libuwsc version 3.3.2
2019/09/10 11:49:40 (main.c:463) rtty version 6.6.1
2019/09/10 11:49:40 (main.c:286) onerror:2: Invalid header
2019/09/10 11:49:45 (main.c:286) onerror:2: Invalid header
2019/09/10 11:49:51 (main.c:286) onerror:2: Invalid header
2019/09/10 11:49:56 (main.c:286) onerror:2: Invalid header

服务端没没有错误日志
我使用了nginx代理

  location / {
    auth_basic "Please input password";
    auth_basic_user_file /etc/nginx/passwd;
    proxy_pass http://127.0.0.1:5912/;
    proxy_http_version 1.1;
    proxy_read_timeout 300;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-PORT $remote_port;
  }

/etc/nginx/passwd是我使用命令生成的密码文件,如何在连接是输入密码

rttys后台被系统杀掉了

运行一段时间后,发现rttys进程不见了,查看/var/log/messages,发现如下log

Jan 7 20:26:53 pc rttys: #33[90m2021-01-07T20:26:53+08:00#033[0m |#33[31mERRO#033[0m| #33[0mdevice.go:102#033[0m |#33[0mInactive device in long time: 2ae1d6877ab4479b8ad752a96ecaffbf#033[0m

Jan 7 20:26:54 pc rttys: #33[90m2021-01-07T20:26:54+08:00#033[0m |#33[31mERRO#033[0m| #33[0mdevice.go:102#033[0m |#33[0mInactive device in long time: 2ae1d6877ab4479b8ad752a96ecaffbf#033[0m

Jan 7 20:26:55 pc rttys: #33[90m2021-01-07T20:26:55+08:00#033[0m |#33[31mERRO#033[0m| #33[0mdevice.go:102#033[0m |#33[0mInactive device in long time: 2ae1d6877ab4479b8ad752a96ecaffbf#033[0m

Jan 7 20:26:55 pc rttys: #33[90m2021-01-07T20:26:55+08:00#033[0m |#33[31mERRO#033[0m| #33[0mdevice.go:104#033[0m |#33[0mInactive 3 times, now kill it: 2ae1d6877ab4479b8ad752a96ecaffbf#033[0m

Jan 7 20:26:56 pc rttys: #33[90m2021-01-07T20:26:56+08:00#033[0m |#33[32mINFO#033[0m| #33[0mdevice.go:132#033[0m |#33[0mDevice '2ae1d6877ab4479b8ad752a96ecaffbf' closed#033[0m

怎么处理呀?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.