mirror of
https://github.com/fiatjaf/khatru.git
synced 2026-06-05 18:21:31 +02:00
include original http.Request in WebSocket struct.
This commit is contained in:
@@ -45,6 +45,7 @@ func (rl *Relay) HandleWebsocket(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
ws := &WebSocket{
|
ws := &WebSocket{
|
||||||
conn: conn,
|
conn: conn,
|
||||||
|
Request: r,
|
||||||
Challenge: hex.EncodeToString(challenge),
|
Challenge: hex.EncodeToString(challenge),
|
||||||
Authed: make(chan struct{}),
|
Authed: make(chan struct{}),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package khatru
|
package khatru
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/fasthttp/websocket"
|
"github.com/fasthttp/websocket"
|
||||||
@@ -10,6 +11,9 @@ type WebSocket struct {
|
|||||||
conn *websocket.Conn
|
conn *websocket.Conn
|
||||||
mutex sync.Mutex
|
mutex sync.Mutex
|
||||||
|
|
||||||
|
// original request
|
||||||
|
Request *http.Request
|
||||||
|
|
||||||
// nip42
|
// nip42
|
||||||
Challenge string
|
Challenge string
|
||||||
AuthedPublicKey string
|
AuthedPublicKey string
|
||||||
|
|||||||
Reference in New Issue
Block a user