Code Monkey home page Code Monkey logo

rustdesk-api-server's Introduction

rustdesk-api-server

RustDesk Api 服务器端 Go语言版本,支持sqlite3、mysql数据库

登录后可返回同账号下所有在用主机 以本号归属开头

Build Release

编译

安装Golang

安装GCC并配置PATH

使用方法

修改数据库连接

修改 conf/config.yml 中的配置项

dbtype: mysql # 支持mysql或者sqlite3
mysql:
  host: '127.0.0.1'
  port: 3306 
  database: 'rustdesk' # 数据库名
  username: 'root' # 数据库用户名
  password: '' # 数据库密码
app:
  authkey: 123456 # 授权密码 添加账号或者修改密码使用
  cryptkey: 123123123123  # 密码加密盐值 建议首次修改后面别改 = =

搭建跑起来

  1. 运行程序

    1. 运行程序会自动创建数据表
  2. 端口映射(推荐):

直接将21114端口号映射出来 貌似rustdesk默认端口是21114 至少手机端我是~~

nginx服务器:

进行反向代理 反向代理可使用80端口什么的

#PROXY-START/

location ^~ /
{
    proxy_pass http://127.0.0.1:21114;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_http_version 1.1;
    # proxy_hide_header Upgrade;

    add_header X-Cache $upstream_cache_status;

    #Set Nginx Cache
    
    
    set $static_file10BAHqk7 0;
    if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
    {
    	set $static_file10BAHqk7 1;
    	expires 1m;
        }
    if ( $static_file10BAHqk7 = 0 )
    {
    add_header Cache-Control no-cache;
    }
}

#PROXY-END/

RustDesk配置

ID服务器和中继服务器可自行寻找Docker进行安装

此处只说明API服务器配置 img.png

安卓端不需要填写 http:// 前缀 且必须为 21114 端口

创建账号

请求 http://127.0.0.1:21114/api/reg?username=test&password=test&auth_key=123456

修改密码

请求 http://127.0.0.1:21114/api/set-pwd?username=test&password=test&auth_key=123456

注意

保存地址簿时 username 等于 ---- 时不会进行保存

关于

本项目为学习使用,制作用于 rustdesk 远程协助软件的API服务器交互

使用框架: beego

由于RustDesk接口固定返回内容= =所以接口返回结构不是很统一

赞助

rustdesk-api-server's People

Contributors

xiaoyi510 avatar jimmygalland avatar baichachaa avatar

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.