I'm the client side, I'm connecting to the hub, but I'm not sending headers. Here is my code -
final defaultHeaders = MessageHeaders();
defaultHeaders.setHeaderValue("CashDeskId", "40089");
final connectionOptions = HttpConnectionOptions;
final httpOptions = new HttpConnectionOptions(logger: transportProtLogger, headers: defaultHeaders);
final hubConnection = HubConnectionBuilder().withUrl(serverUrl, options: httpOptions).configureLogging(hubProtLogger).build();
await hubConnection.start();
Here are the logs from the server where all the headers come from -
Info 2022-07-29 16:45:52.1552 Thread: .NET ThreadPool Worker 17
Somebody 2I0q8H1vDwv1yAzbW0wpHw connected
---------------------------------------------------------------------
Info 2022-07-29 16:45:52.1552 Thread: .NET ThreadPool Worker 17
Header key: Accept-Encoding, Header value: gzip
---------------------------------------------------------------------
Info 2022-07-29 16:45:52.1552 Thread: .NET ThreadPool Worker 17
Header key: Cache-Control, Header value: no-cache
---------------------------------------------------------------------
Info 2022-07-29 16:45:52.1552 Thread: .NET ThreadPool Worker 17
Header key: Connection, Header value: Upgrade
---------------------------------------------------------------------
Info 2022-07-29 16:45:52.1552 Thread: .NET ThreadPool Worker 17
Header key: Host, Header value: 10.0.101.141:1212
---------------------------------------------------------------------
Info 2022-07-29 16:45:52.1552 Thread: .NET ThreadPool Worker 17
Header key: Upgrade, Header value: websocket
---------------------------------------------------------------------
Info 2022-07-29 16:45:52.1552 Thread: .NET ThreadPool Worker 17
Header key: User-Agent, Header value: Dart/2.17 (dart:io)
---------------------------------------------------------------------
Info 2022-07-29 16:45:52.1552 Thread: .NET ThreadPool Worker 17
Header key: sec-websocket-version, Header value: 13
---------------------------------------------------------------------
Info 2022-07-29 16:45:52.1552 Thread: .NET ThreadPool Worker 17
Header key: sec-websocket-extensions, Header value: permessage-deflate; client_max_window_bits
---------------------------------------------------------------------
Info 2022-07-29 16:45:52.1552 Thread: .NET ThreadPool Worker 17
Header key: sec-websocket-key, Header value: RpkoC5r23XADW1UYA+RHmQ==
Can you point out my mistake?
PS: The person who wrote the code on the server side checked it and it worked for him, but he wrote in C#