增加重连功能,可动态修改连接参数

This commit is contained in:
bjd 2021-01-25 16:03:33 +08:00
parent 3bb771971c
commit 9e0da33c6a
7 changed files with 26 additions and 2 deletions

View File

@ -1 +0,0 @@

View File

@ -130,6 +130,9 @@ sh bridge-init.sh
添加QQ群: 567510628
## Contribution
欢迎提交 PR、Issues感谢为AnyLink做出贡献
## Other Screenshot

View File

@ -175,6 +175,13 @@ func UserOffline(w http.ResponseWriter, r *http.Request) {
RespSucess(w, nil)
}
func UserReline(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
token := r.FormValue("token")
sessdata.CloseCSess(token)
RespSucess(w, nil)
}
type userAccountMailData struct {
Issuer string
LinkAddr string

View File

@ -35,6 +35,7 @@ func StartAdmin() {
r.HandleFunc("/user/del", UserDel)
r.HandleFunc("/user/online", UserOnline)
r.HandleFunc("/user/offline", UserOffline)
r.HandleFunc("/user/reline", UserReline)
r.HandleFunc("/user/otp_qr", UserOtpQr)
r.HandleFunc("/user/ip_map/list", UserIpMapList)
r.HandleFunc("/user/ip_map/detail", UserIpMapDetail)

View File

@ -2,5 +2,5 @@ package base
const (
APP_NAME = "AnyLink"
APP_VER = "0.0.9"
APP_VER = "0.1.0"
)

View File

@ -1,4 +1,7 @@
// AnyLink 是一个企业级远程办公vpn软件可以支持多人同时在线使用。
// +build linux
package main
import (

View File

@ -296,6 +296,17 @@ func CloseSess(token string) {
sess.CSess.Close()
}
func CloseCSess(token string) {
sessMux.Lock()
defer sessMux.Unlock()
sess, ok := sessions[token]
if !ok {
return
}
sess.CSess.Close()
}
func DelSessByStoken(stoken string) {
stoken = strings.TrimSpace(stoken)
sarr := strings.Split(stoken, "@")