mirror of
https://github.com/vale981/agent
synced 2025-03-04 09:01:42 -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,11 +61,13 @@ func NewAPIServer(token string, indiServerAddr string, phd2ServerAddr string, po
|
|||
port: port,
|
||||
isTLS: isTLS,
|
||||
e: echo.New(),
|
||||
upgrader: websocket.Upgrader{},
|
||||
connList: []net.Conn{},
|
||||
indiProfile: indiProfile,
|
||||
currMode: currMode,
|
||||
agentModes: agentModes,
|
||||
upgrader: websocket.Upgrader{
|
||||
EnableCompression: true,
|
||||
},
|
||||
connList: []net.Conn{},
|
||||
indiProfile: indiProfile,
|
||||
currMode: currMode,
|
||||
agentModes: agentModes,
|
||||
}
|
||||
|
||||
if logutil.IsDev {
|
||||
|
@ -91,7 +93,9 @@ func NewAPIServer(token string, indiServerAddr string, phd2ServerAddr string, po
|
|||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return allowedOrigins[host]
|
||||
|
||||
// check both host and host:port from --api-origins param values
|
||||
return allowedOrigins[host] || allowedOrigins[u.Host]
|
||||
}
|
||||
|
||||
return apiServer
|
||||
|
|
Loading…
Add table
Reference in a new issue