-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Add custom query params to make-channel-socket! #158
Conversation
This patch allows the user to pass additional query parameters in the additional web socket connection. These can be used for authentication. Websockets don't have an API to pass any headers, so any out of band information has to go over the query params. Fixes #135
@@ -754,7 +754,7 @@ | |||
|
|||
#+cljs ;; Handles reconnects, keep-alives, callbacks: | |||
(defrecord ChWebSocket | |||
[client-id url chs socket_ kalive-ms kalive-timer_ kalive-due?_ nattempt_ | |||
[client-id url params chs socket_ kalive-ms kalive-timer_ kalive-due?_ nattempt_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client-id
and params
could be combined.
Hi Daniel, Thanks for the clear PR, much appreciated! 👍 Am I correct in understanding that this change is just to make it easier to include query-params in the chsk URL? You're aware that the URL/path can already contain query params, right? |
This looks good to me btw, will merge + cut a new release if you give me the go-ahead.
Think probably better to keep them separated as you have. They're semantically different (params are user-space, client-id required for the implementation). |
Rereading #135 (comment) earlier today when working on this PR I finally clicked on what you were meaning last month. However now that chsk-url-fn has been deprecated I don't see any other way to influence the URL that is used for the connection?
That's how I felt too. Thanks! |
Oh, just with the Does that make sense? Sorry if I wasn't too clear before. In any case, happy with this PR since it definitely makes things easier. Is that... a gopher? :-) |
Add custom query params to make-channel-socket!
Oh btw see you adjusted this to target the dev branch, thanks! |
That's the shipit emoji :) |
Perhaps telling that I've never seen it before ;-) Okay, |
Yep, closed it now. Thanks! |
Quick update: just pushed |
Thanks, and sorry about that. |
Oh, no problem - easy to miss. PR was very helpful, wouldn't have gotten to this otherwise. |
This patch allows the user to pass additional query parameters in the additional web socket connection. These can be used for authentication. Websockets don't have an API to pass any headers, so any out of band information has to go over the query params.
Because
:chsk-url-fn
has been deprecated, I think we need to have another parameter for this. A slightly different approach would be to adjust the internal API so client-id isn't passed separately to themap->*
functions, but instead we just pass a map of params.Fixes #135