This commit is contained in:
esrrhs 2023-03-18 13:32:35 +08:00
parent f8d9ed6b5e
commit 520cdd7063
10 changed files with 16 additions and 15 deletions

View File

@ -1,4 +1,4 @@
package main
package pingtunnel
import (
"github.com/esrrhs/gohome/common"

View File

@ -5,6 +5,7 @@ import (
"fmt"
"github.com/esrrhs/gohome/common"
"github.com/esrrhs/gohome/loggo"
"github.com/esrrhs/pingtunnel"
"net"
"net/http"
_ "net/http/pprof"
@ -166,8 +167,8 @@ func main() {
*tcpmode = 1
}
}
if *tcpmode_maxwin*10 > FRAME_MAX_ID {
fmt.Println("set tcp win to big, max = " + strconv.Itoa(FRAME_MAX_ID/10))
if *tcpmode_maxwin*10 > pingtunnel.FRAME_MAX_ID {
fmt.Println("set tcp win to big, max = " + strconv.Itoa(pingtunnel.FRAME_MAX_ID/10))
return
}
@ -186,7 +187,7 @@ func main() {
loggo.Info("key %d", *key)
if *t == "server" {
s, err := NewServer(*key, *maxconn, *max_process_thread, *max_process_buffer, *conntt)
s, err := pingtunnel.NewServer(*key, *maxconn, *max_process_thread, *max_process_buffer, *conntt)
if err != nil {
loggo.Error("ERROR: %s", err.Error())
return
@ -213,7 +214,7 @@ func main() {
}
if len(*s5filter) > 0 {
err := LoadGeoDB(*s5ftfile)
err := pingtunnel.LoadGeoDB(*s5ftfile)
if err != nil {
loggo.Error("Load Sock5 ip file ERROR: %s", err.Error())
return
@ -229,7 +230,7 @@ func main() {
return false
}
ret, err := GetCountryIsoCode(taddr.IP.String())
ret, err := pingtunnel.GetCountryIsoCode(taddr.IP.String())
if err != nil {
return false
}
@ -239,7 +240,7 @@ func main() {
return ret != *s5filter
}
c, err := NewClient(*listen, *server, *target, *timeout, *key,
c, err := pingtunnel.NewClient(*listen, *server, *target, *timeout, *key,
*tcpmode, *tcpmode_buffersize, *tcpmode_maxwin, *tcpmode_resend_timems, *tcpmode_compress,
*tcpmode_stat, *open_sock5, *maxconn, &filter)
if err != nil {

View File

@ -1,4 +1,4 @@
package main
package pingtunnel
import (
"errors"

View File

@ -1,4 +1,4 @@
package main
package pingtunnel
import (
"fmt"

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/esrrhs/pingtunnul
module github.com/esrrhs/pingtunnel
go 1.18

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: msg.proto
package main
package pingtunnel
import (
fmt "fmt"

View File

@ -1,5 +1,5 @@
syntax = "proto3";
option go_package = "main";
option go_package = "pingtunnel";
message MyMsg {
enum TYPE {

View File

@ -1,4 +1,4 @@
package main
package pingtunnel
import (
"encoding/binary"

View File

@ -1,4 +1,4 @@
package main
package pingtunnel
import (
"fmt"

View File

@ -1,4 +1,4 @@
package main
package pingtunnel
import (
"github.com/esrrhs/gohome/common"