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

+4 -1
View File
@@ -51,7 +51,7 @@ func NewTProxyServer(s string, dialer proxy.Dialer) (proxy.Server, error) {
}
// ListenAndServe .
func (s *TProxy) ListenAndServe(_ net.Conn) {
func (s *TProxy) ListenAndServe() {
// go s.ListenAndServeTCP()
s.ListenAndServeUDP()
}
@@ -114,6 +114,9 @@ func (s *TProxy) ListenAndServeUDP() {
}
// Serve .
func (s *TProxy) Serve(c net.Conn) {}
// ReadFromUDP reads a UDP packet from c, copying the payload into b.
// It returns the number of bytes copied into b and the return address
// that was on the packet.