This commit is contained in:
kony
2024-12-21 13:20:35 +08:00
parent 0911da8655
commit d59fc6a528
5 changed files with 10 additions and 10 deletions

10
main.go
View File

@@ -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)
}

View File

@@ -1,4 +1,4 @@
package process
package pro
import (
"encoding/json"

View File

@@ -1,4 +1,4 @@
package process
package pro
import (
"fmt"

View File

@@ -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 {

View File

@@ -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 {