Closed morpheus65535 closed 4 years ago
Nice one morph
Probably this weekend i'll work on this new feature. i'm thining about adding the parameter to the options in with_url method
hub_connection = HubConnectionBuilder()\ .with_url(server_url, options={ "access_token_factory": lambda: signalr_core_example_login(login_url, username, password), "querystring": "a=3&b=5" }).with_automatic_reconnect({ "type": "interval", "keep_alive_interval": 10, "intervals": [1, 3, 5, 6, 7, 87, 3] })\ .build()
what do you think about this way?
Should be perfectly fine to me! :-)
I've tried doing it by adding an attribute to the HubConnectionBuilder class but on_error is raised there: https://github.com/mandrewcito/signalrcore/blob/0351acf9f40eff3e452ec0de548e7063ea38d224/signalrcore/hub/base_hub_connection.py#L65
So, you had a nice weekend? ;-)
yes, as soon i'll finish tests automation i merge the branch with changes. Only one test container left.
Ok let me know so I can test it with my signalR feed. Thank you!
on version 0.7.7 you can add a querystring and library will manage it for you
connection = HubConnectionBuilder()\ .with_url("ws://localhost:83/hubs/chat?myid=234", options={ "access_token_factory": self.login })\ .configure_logging(logging.DEBUG)\ .with_automatic_reconnect({ "type": "raw", "keep_alive_interval": 10, "reconnect_interval": 5, "max_attempts": 5 }).build()
with this, 'myid=234' will be placed on hub connection url and negotiate url
Thanks!
This doesn't work in Python 2.x: https://github.com/mandrewcito/signalrcore/blob/c09bb83c5541081178ff38574acfa347938aaf61/signalrcore/hub/base_hub_connection.py#L56-L57
Yes, i just released this fix on the following version(0.78) with the 'additional headers params' request. But Im thinking about stopping python2 support, because in 2020 python2 will not be maintained.
Yes I'm in the process of porting Bazarr to Python 3 also to be able to drop Python 2.7 support but in the mean time, I still have to be backward compatible... :-/
Thanks by the way!
Is your feature request related to a problem? Please describe. I'm trying to connect to a SignalR feed that require the use of an
apikey
parameters to be passed as a query string argument (?apikey=abc123...
).Describe the solution you'd like Would be great to have a
qs
attribute for theHubConnectionBuilder
class.Describe alternatives you've considered I've tried to append the apikey argument to my
server_url
but I get this error:Handshake status 400 Bad Request <class 'websocket._exceptions.WebSocketBadStatusException'>
Additional context Thanks for this great module!