server: changed interface definition and implementation

This commit is contained in:
nadoo committed 2018-11-25 13:18:15 +08:00
1 parent 2813e80a98
commit d37c2e2a35
14 files changed
+207 -240

No files matched your search

+6 -1
View File
@@ -64,7 +64,7 @@ func NewRedir6Server(s string, dialer proxy.Dialer) (proxy.Server, error) {
}
// ListenAndServe .
func (s *RedirProxy) ListenAndServe(_ net.Conn) {
func (s *RedirProxy) ListenAndServe() {
l, err := net.Listen("tcp", s.addr)
if err != nil {
log.F("[redir] failed to listen on %s: %v", s.addr, err)
@@ -114,6 +114,11 @@ func (s *RedirProxy) ListenAndServe(_ net.Conn) {
}
}
// Serve .
func (s *RedirProxy) Serve(c net.Conn) {
}
// Get the original destination of a TCP connection.
func getOrigDst(conn net.Conn, ipv6 bool) (socks.Addr, error) {
c, ok := conn.(*net.TCPConn)