实现tproxy,添加tproxy示例文件.未经测试,很可能有问题.

This commit is contained in:
hahafool
2022-04-20 13:22:10 +08:00
parent 9a1afe18c9
commit b8a27ab713
12 changed files with 218 additions and 42 deletions

View File

@@ -13,7 +13,6 @@ import (
"io"
"log"
"net"
"os"
"reflect"
"syscall"
@@ -129,19 +128,3 @@ func (c *ReadWrapper) WriteBuffers(buffers [][]byte) (int64, error) {
return int64(n), e
}
//用于 listen和 dial 配置一些底层参数.
type Sockopt struct {
TProxy bool `toml:"tproxy"`
Somark int `toml:"mark"`
}
type ListenerWithFile interface {
net.Listener
File() (f *os.File, err error)
}
type ConnWithFile interface {
net.Conn
File() (f *os.File, err error)
}