Plumb connection limit to proxy and output it (#384)
This commit is contained in:
1 parent
7db0e2a5ed
commit
f7e48ec836
9 files changed
+149
-59
No files matched your search
@@ -110,7 +110,8 @@ func (w *Worker) handleProxy() http.HandlerFunc {
|
||||
}
|
||||
|
||||
var ci *connInfo
|
||||
ci, err = w.authorizeConnection(r.Context(), sessionId)
|
||||
var connsLeft int32
|
||||
ci, connsLeft, err = w.authorizeConnection(r.Context(), sessionId)
|
||||
if err != nil {
|
||||
w.logger.Error("unable to authorize conneciton", "error", err)
|
||||
conn.Close(websocket.StatusInternalError, "unable to authorize connection")
|
||||
@@ -127,7 +128,8 @@ func (w *Worker) handleProxy() http.HandlerFunc {
|
||||
w.logger.Trace("authorized connection", "connection_id", ci.id)
|
||||
|
||||
handshakeResult := &proxy.HandshakeResult{
|
||||
Expiration: expiration,
|
||||
Expiration: expiration,
|
||||
ConnectionsLeft: connsLeft,
|
||||
}
|
||||
if err := wspb.Write(connCtx, conn, handshakeResult); err != nil {
|
||||
w.logger.Error("error sending handshake result to client", "error", err)
|
||||
|
||||
Reference in new issue
Block a user