Skip to content

Commit

Permalink
Revert "Feat: change websocket host id implementation"
Browse files Browse the repository at this point in the history
  • Loading branch information
humansinstitute authored Jan 14, 2025
1 parent 14b4182 commit 79ee01d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions websocket/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/gorilla/websocket"
"github.com/stakwork/sphinx-tribes/config"
"github.com/stakwork/sphinx-tribes/utils"
)

var WebsocketPool = NewPool()
Expand Down Expand Up @@ -35,9 +36,7 @@ func Upgrade(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error) {
}

func ServeWs(pool *Pool, w http.ResponseWriter, r *http.Request) {
// get url query params
queryParams := r.URL.Query()
uniqueId := queryParams.Get("uniqueId")
websocketToken := utils.GetRandomToken(40)

conn, err := Upgrade(w, r)
if err != nil {
Expand All @@ -46,7 +45,7 @@ func ServeWs(pool *Pool, w http.ResponseWriter, r *http.Request) {
}

client := &Client{
Host: uniqueId,
Host: websocketToken,
Conn: conn,
Pool: pool,
}
Expand Down

0 comments on commit 79ee01d

Please sign in to comment.