Note that on multiple instances of the API gateway, the connection manager needs to store the connections on a separate shared storage.
()
| 35 | |
| 36 | // Note that on multiple instances of the API gateway, the connection manager needs to store the connections on a separate shared storage. |
| 37 | func NewConnectionManager() *ConnectionManager { |
| 38 | return &ConnectionManager{ |
| 39 | connections: make(map[string]*connWrapper), |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | func (cm *ConnectionManager) Upgrade(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error) { |
| 44 | conn, err := upgrader.Upgrade(w, r, nil) |