MCPcopy Index your code
hub / github.com/projectdiscovery/proxify / Run

Method Run

socket.go:87–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85}
86
87func (p *SocketProxy) Run() error {
88 var (
89 listener net.Listener
90 err error
91 )
92 if p.options.TLSServer {
93 config := &tls.Config{InsecureSkipVerify: true}
94 if p.options.TLSServerConfig != nil {
95 config = p.options.TLSServerConfig
96 }
97 listener, err = tls.Listen(p.options.Protocol, p.options.ListenAddress, config)
98 } else {
99 listener, err = net.Listen(p.options.Protocol, p.options.ListenAddress)
100 }
101 if err != nil {
102 return err
103 }
104
105 for {
106 conn, err := listener.Accept()
107 if err != nil {
108 log.Println(err)
109 return err
110 }
111 go p.Proxy(conn) //nolint
112 }
113}
114
115func (p *SocketProxy) Proxy(conn net.Conn) error {
116 var (

Callers 1

mainFunction · 0.95

Calls 1

ProxyMethod · 0.95

Tested by

no test coverage detected