Should anyone be interested, I wrote up how to use Elm websockets in a way that 
matches the exposition in /Programming Phoenix/: 

http://stackoverflow.com/questions/40475348/how-do-i-pass-connection-time-websocket-parameters-to-phoenix-from-elm

> On Nov 6, 2016, at 7:09 PM, Brian Marick <[email protected]> wrote:
> 
> Sigh. https://twitter.com/jessemcnelis <https://twitter.com/jessemcnelis> 
> pointed me to http://klaftertief.github.io/elm-search/?q=uriencode 
> <http://klaftertief.github.io/elm-search/?q=uriencode> - which works just 
> fine. 
> 
> Sorry for the inconvenience.
> 
>> On Nov 6, 2016, at 6:23 PM, Brian Marick <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> TL/DR: What library do I use to convert `…##...=`   into   `...%23%...%3D`   
>> in order to communicate with Elixir Phoenix via 
>> `ws://localhost:4000/socket/websocket?auth_token=...%23%...%3D` 
>> <ws://localhost:4000/socket/websocket?auth_token=%3Csecond_string_above%3E%60>?
>> 
>> -------
>> 
>> In the /Programming Phoenix/ book 
>> https://pragprog.com/book/phoenix/programming-phoenix 
>> <https://pragprog.com/book/phoenix/programming-phoenix>, the sample app uses 
>> token-based authentication, with the client establishing its authenticity at 
>> connect-time, rather than at channel-joining time. Phoenix allows params to 
>> be passed at connect-time via `?foo=bar” format in the URI.  Neither 
>> fbonetti/elm-phoenix-socket nor NoRedInk/elm-phoenix seem to give you a way 
>> to do that, other than constructing the URI yourself. Which is OK - I can 
>> submit a pull request once I get it working. 
>> 
>> However, quick browsing through `package.elm-lang.org 
>> <http://package.elm-lang.org/>` doesn’t find me a quick library to do uri 
>> encoding. I find only 
>> https://github.com/williamwhitacre/elm-encoding/blob/master/Encoding/URL.elm 
>> <https://github.com/williamwhitacre/elm-encoding/blob/master/Encoding/URL.elm>
>>  , which is listed as not having been updated to 0.17. 
>> 
>> Am I overlooking a library, or should I try to port `elm-encoding`?
>> 
>> P.S. I know that I could deviate from the book and do the authentication at 
>> channel-join time, but I think it would be good for Elm if it were 
>> friction-free to work along with the book’s example, just using Elm instead 
>> of JS. 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Elm Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] 
>> <mailto:[email protected]>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to