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]. For more options, visit https://groups.google.com/d/optout.
