-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HubConnectionBuilder not passing Message headers to Server Hub #24
Comments
Team any workaround or fix for this? |
I have a similar problem, were you able to solve it? |
No, and end up using signalr_pure, you may try it. Hope it works. |
Can't find headers, how to send them? |
Remember this is for the signalr_pure package
void main() async { |
Bro, thanks a lot. I spent about 4 days sending headers via signalr_netcore |
Here is being created empty |
Is anyone working on this? |
package: final HubConnectionBuilder builder = HubConnectionBuilder()
..url = _url
..logLevel = LogLevel.critical
..httpConnectionOptions = HttpConnectionOptions(
headers: {
"remote-ip-address": ipAddress ?? "",
"platform-type": PlatformInfo().platform.name.capitalizeFirstLetter()
},
)
..reconnect = true;
_connection = builder.build(); |
Any update on this? |
Really too bad |
Is there a solution? I'm trying to send the header but it just won't, I've tried many ways and none of them get the server-side header |
The header reaches the server, but it is not recognized during the update process. Does "X-Requested-With: FlutterHttpClient" not recognize this part? |
The header reaches the server, but it is not recognized during the update process. Does X-Requested-With: FlutterHttpClient not recognize this part?
|
WebSocket protocol differs from HTTP/HTTPS by enabling bidirectional data exchange across multiple frames instead of just a single request. A WebSocket connection usually starts with HTTP/HTTPS and then transitions to WebSocket with an upgrade request. As seen in the provided logs, the indication ( In WebSocket protocol, a different approach is needed to send custom headers. Typically, custom data is transmitted during connection setup or when sending messages in WebSocket. To include user identification information when setting up a WebSocket connection, you need to add this information on the client side during WebSocket connection establishment. The server can then read and process this information upon WebSocket connection establishment. The specific method may vary depending on the WebSocket library and framework in use. If you can provide additional information about the WebSocket library you are using, it would be helpful. |
Has the header transmission been resolved? |
When configuring HubConnectionBuilder().withUrl options headers. The headers are not been pass to the server hub.
My Code:
final headers = MessageHeaders();
headers.setHeaderValue("MyHeader-One", "MY-VALUE1");
headers.setHeaderValue("MyHeader-Two", "MY-VALUE2");
hubConnection = HubConnectionBuilder()
.withUrl(
serverUrl,
options: HttpConnectionOptions(
headers: headers,
transport: HttpTransportType.LongPolling,
),
)
.withAutomaticReconnect()
.build();
Header MyHeader-One and MyHeader-Two are not been received at Hub
The text was updated successfully, but these errors were encountered: