SignalR sending wont send custom headers
try{
const conn = new HubConnectionBuilder()
.withUrl("http://localhost:4000/chat", {
accessTokenFactory: () => {
console.log(token)
return token
},
withCredentials: true,
headers:{
"test":"test"
}
})
.configureLogging(LogLevel.Information).build()
await conn.start();
const re = await conn.invoke("CreateChatRoom", "num", id); console.log(re) }catch(e){ console.log(e) } _httpContext.HttpContext.Request.Headers.ToList().ForEach(e => Console.WriteLine(e)); i wont get the custom or auth headers on the server
await conn.start();
const re = await conn.invoke("CreateChatRoom", "num", id); console.log(re) }catch(e){ console.log(e) } _httpContext.HttpContext.Request.Headers.ToList().ForEach(e => Console.WriteLine(e)); i wont get the custom or auth headers on the server
12 Replies
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
?
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
i just want to see the all the headers iam getting in the req for debugging purposes
and no i dont have a repo
its a client issue because when i check the network tab the headers arent getting sent
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
can u even send custom header after the websocket has been created
idk
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
if it was a simple requesst I would guess you could be its a websocket so I assume u will have to pass those data in a different way maybe?
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
that is prior having a websocket
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View