mirror of
https://gitee.com/konyshe/goodlink.git
synced 2025-09-26 20:51:22 +08:00
u
This commit is contained in:
10
main.go
10
main.go
@@ -2,8 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"gogo"
|
||||
"goodlink/process"
|
||||
_ "goodlink/process"
|
||||
"goodlink/pro"
|
||||
_ "goodlink/pro"
|
||||
"goodlink/stun2"
|
||||
"log"
|
||||
"net/http"
|
||||
@@ -29,11 +29,11 @@ func main2() {
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
process.Init(m_cli_redis_addr, m_cli_redis_pass, m_cli_redis_id, m_cli_tun_key)
|
||||
pro.Init(m_cli_redis_addr, m_cli_redis_pass, m_cli_redis_id, m_cli_tun_key)
|
||||
|
||||
if m_cli_tun_local_addr != "" {
|
||||
go func() {
|
||||
if err := process.RunLocal(m_cli_conn_type,
|
||||
if err := pro.RunLocal(m_cli_conn_type,
|
||||
m_cli_tun_local_addr,
|
||||
m_cli_tun_key,
|
||||
true); err != nil {
|
||||
@@ -43,7 +43,7 @@ func main2() {
|
||||
}
|
||||
}()
|
||||
} else {
|
||||
go process.RunRemote(m_cli_tun_remote_addr,
|
||||
go pro.RunRemote(m_cli_tun_remote_addr,
|
||||
m_cli_tun_key,
|
||||
time.Duration(m_cli_stun_timeout)*time.Second)
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package process
|
||||
package pro
|
||||
|
||||
import (
|
||||
"encoding/json"
|
@@ -1,4 +1,4 @@
|
||||
package process
|
||||
package pro
|
||||
|
||||
import (
|
||||
"fmt"
|
@@ -1,4 +1,4 @@
|
||||
package process
|
||||
package pro
|
||||
|
||||
import (
|
||||
"goodlink/proxy"
|
||||
@@ -25,7 +25,7 @@ func GetRemoteQuicConn(time_out time.Duration) (quic.Connection, quic.Stream) {
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
for RedisGet(&redisJson) != nil {
|
||||
time.Sleep(3 * time.Second)
|
||||
time.Sleep(5 * time.Second)
|
||||
}
|
||||
|
||||
if redisJson.State < last_state {
|
@@ -122,7 +122,7 @@ func (s *Server) Serve(c net.PacketConn) error {
|
||||
}
|
||||
}
|
||||
|
||||
// ListenUDPAndServe listens on laddr and process incoming packets.
|
||||
// ListenUDPAndServe listens on laddr and pro incoming packets.
|
||||
func ListenUDPAndServe(serverNet, laddr string) error {
|
||||
c, err := net.ListenPacket(serverNet, laddr)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user