mirror of
https://github.com/vale981/agent
synced 2025-03-05 09:31:39 -05:00
permessage-deflate WS-extension support added
This commit is contained in:
parent
6afcf489f5
commit
84b1742f4e
1 changed files with 10 additions and 6 deletions
|
@ -61,7 +61,9 @@ func NewAPIServer(token string, indiServerAddr string, phd2ServerAddr string, po
|
||||||
port: port,
|
port: port,
|
||||||
isTLS: isTLS,
|
isTLS: isTLS,
|
||||||
e: echo.New(),
|
e: echo.New(),
|
||||||
upgrader: websocket.Upgrader{},
|
upgrader: websocket.Upgrader{
|
||||||
|
EnableCompression: true,
|
||||||
|
},
|
||||||
connList: []net.Conn{},
|
connList: []net.Conn{},
|
||||||
indiProfile: indiProfile,
|
indiProfile: indiProfile,
|
||||||
currMode: currMode,
|
currMode: currMode,
|
||||||
|
@ -91,7 +93,9 @@ func NewAPIServer(token string, indiServerAddr string, phd2ServerAddr string, po
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return allowedOrigins[host]
|
|
||||||
|
// check both host and host:port from --api-origins param values
|
||||||
|
return allowedOrigins[host] || allowedOrigins[u.Host]
|
||||||
}
|
}
|
||||||
|
|
||||||
return apiServer
|
return apiServer
|
||||||
|
|
Loading…
Add table
Reference in a new issue