C#C
C#2y ago
heloo

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
Was this page helpful?