Commit be1f0502 authored by ginuerzh's avatar ginuerzh

fix redirect on non linux OS

parent 0de7b8fb
// +build !windows // +build linux
package gost package gost
......
// +build windows // +build !linux
package gost package gost
import ( import (
"errors"
"net" "net"
"github.com/go-log/log" "github.com/go-log/log"
...@@ -33,3 +34,24 @@ func (h *tcpRedirectHandler) Handle(c net.Conn) { ...@@ -33,3 +34,24 @@ func (h *tcpRedirectHandler) Handle(c net.Conn) {
log.Log("[red-tcp] TCP redirect is not available on the Windows platform") log.Log("[red-tcp] TCP redirect is not available on the Windows platform")
c.Close() c.Close()
} }
type udpRedirectHandler struct {
}
// UDPRedirectHandler creates a server Handler for UDP transparent server.
func UDPRedirectHandler(opts ...HandlerOption) Handler {
return &udpRedirectHandler{}
}
func (h *udpRedirectHandler) Init(options ...HandlerOption) {
}
func (h *udpRedirectHandler) Handle(conn net.Conn) {
log.Log("[red-udp] UDP redirect is not available on the Windows platform")
conn.Close()
}
// UDPRedirectListener creates a Listener for UDP transparent proxy server.
func UDPRedirectListener(addr string, cfg *UDPListenConfig) (Listener, error) {
return nil, errors.New("UDP redirect is not available on the Windows platform")
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment