mirror of
https://github.com/fatedier/frp.git
synced 2026-01-11 22:23:12 +00:00
newhttp: support websocket
This commit is contained in:
@@ -79,6 +79,11 @@ func NewHttpReverseProxy() *HttpReverseProxy {
|
||||
return rp.CreateConnection(host, url)
|
||||
},
|
||||
},
|
||||
WebSocketDialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
url := ctx.Value("url").(string)
|
||||
host := getHostFromAddr(ctx.Value("host").(string))
|
||||
return rp.CreateConnection(host, url)
|
||||
},
|
||||
BufferPool: newWrapPool(),
|
||||
ErrorLog: log.New(newWrapLogger(), "", 0),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user