File tree Expand file tree Collapse file tree 3 files changed +58
-36
lines changed Expand file tree Collapse file tree 3 files changed +58
-36
lines changed Original file line number Diff line number Diff line change 1
- // +build !windows
1
+ // +build linux
2
2
3
3
package gost
4
4
Original file line number Diff line number Diff line change
1
+ // +build !linux
2
+
3
+ package gost
4
+
5
+ import (
6
+ "errors"
7
+ "net"
8
+
9
+ "github.com/go-log/log"
10
+ )
11
+
12
+ type tcpRedirectHandler struct {
13
+ options * HandlerOptions
14
+ }
15
+
16
+ // TCPRedirectHandler creates a server Handler for TCP redirect server.
17
+ func TCPRedirectHandler (opts ... HandlerOption ) Handler {
18
+ h := & tcpRedirectHandler {
19
+ options : & HandlerOptions {
20
+ Chain : new (Chain ),
21
+ },
22
+ }
23
+ for _ , opt := range opts {
24
+ opt (h .options )
25
+ }
26
+ return h
27
+ }
28
+
29
+ func (h * tcpRedirectHandler ) Init (options ... HandlerOption ) {
30
+ log .Log ("[red-tcp] TCP redirect is not available on the Windows platform" )
31
+ }
32
+
33
+ func (h * tcpRedirectHandler ) Handle (c net.Conn ) {
34
+ log .Log ("[red-tcp] TCP redirect is not available on the Windows platform" )
35
+ c .Close ()
36
+ }
37
+
38
+ type udpRedirectHandler struct {
39
+ }
40
+
41
+ // UDPRedirectHandler creates a server Handler for UDP transparent server.
42
+ func UDPRedirectHandler (opts ... HandlerOption ) Handler {
43
+ return & udpRedirectHandler {}
44
+ }
45
+
46
+ func (h * udpRedirectHandler ) Init (options ... HandlerOption ) {
47
+ }
48
+
49
+ func (h * udpRedirectHandler ) Handle (conn net.Conn ) {
50
+ log .Log ("[red-udp] UDP redirect is not available on the Windows platform" )
51
+ conn .Close ()
52
+ }
53
+
54
+ // UDPRedirectListener creates a Listener for UDP transparent proxy server.
55
+ func UDPRedirectListener (addr string , cfg * UDPListenConfig ) (Listener , error ) {
56
+ return nil , errors .New ("UDP redirect is not available on the Windows platform" )
57
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments