Unfortunately the presence of SSL is only really indicated by the X-Forwarded-Proto header which is set to https. This tells Mojo::Message::Request that the request was proxied from https (if the hypnotoad proxy setting or MOJO_REVERSE_PROXY is enabled), but doesn't say anything about the ws protocol. I think you'll have to do something manually.
On Wed, Aug 10, 2016 at 11:58 AM, Stefan Adams <[email protected]> wrote: > I start my app on non-SSL only as the SSL is happening at the proxy and > the proxy passes to the non-SSL app. Now the auto-route generation (e.g. > url_for) gives me a URL of ws://... instead of the needed wss://... and so > I get this error in the browser: > > Mixed Content: The page at 'https://.../' was loaded over HTTPS, but > attempted to connect to the insecure WebSocket endpoint 'ws://.../pals'. > This request has been blocked; this endpoint must be available over WSS. > > > How can I have url_for (to_abs) create me a URL on SSL when the app itself > isn't aware that SSL is available? > > -- > You received this message because you are subscribed to the Google Groups > "Mojolicious" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/mojolicious. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
