jononomo
What setting determines whether I run websockets over ws:// or wss://?
I’m trying to get websockets working in a non-dev environment and I’m confused about whether I should be using ws:// or wss:// Ideally, I would like my prod environment to mirror my dev environment exactly - with live code reload and no security and so forth.
But for now, I just want to know what setting in my project determines whether I should try to connect to websockets using ws:// or wss://
Also, I’m not sure whether this might be affected by my deployment system, which is convox (praxis) – I think that might force me into https/wss. But long story short - how can I check which one it is? Especially for websockets.
Most Liked
Azolo
ws:// is basically signaling to upgrade an http request, whereas wss:// is signaling to negotiate an ssl connection then upgrade a http request.
Just for clarification, https:// is just signaling to negotiate an ssl then handle an http request.
Are you going to use or force https in production?
If yes, then use wss. If no, then use ws.
Here is the guide to setup ssl on Phoenix if you need a place to look for the settings.
Popular in Questions
Other popular topics
Latest Phoenix Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









