dotnet/aspnetcore

Url can't be changed for easy reconnect

Open

#5,342 建立於 2018年10月1日

在 GitHub 查看
 (12 留言) (2 反應) (0 負責人)C# (10,653 fork)batch import
affected-fewarea-signalrblockedenhancementfeature-client-javafeature-client-javascriptfeature-client-nethelp wantedseverity-minor

倉庫指標

Star
 (37,933 star)
PR 合併指標
 (平均合併 16天 9小時) (30 天內合併 258 個 PR)

描述

Using a client-side cursor (e.g. lastId processed); for a reconnect this wants to be passed back to the server in the query string (as cors doesn't allow custom headers and cors is always applicable to websockets).

However while signalR.HubConnectionBuilder() provides easy construction of the connection; the url cannot be changed after building.

This means if the connection disconnects and you need to pass a cursor (e.g. id); the connection has to be rebuilt and all the events re-registered to the new connection.

It would be easier if the url could be updated and only .start needed to be called again.

貢獻者指南