sintaxi / surge

CLI for the surge.sh CDN
https://surge.sh
2.84k stars 136 forks source link

Force HTTP #398

Closed amaury1093 closed 3 years ago

amaury1093 commented 4 years ago

Yes, I would like to redirect in this direction https->http.

The reason is that my website connects to Websockets over ws:// (and not wss://), which is disallowed on HTTPS websites (mixed content).

Is there a way to either:

  1. Disable redirection from http to https on my-website.surge.sh?
  2. Add redirection from https to http
JasCodes commented 4 years ago

Disabling http to https redirection is simple. Just teardown and make sure you don't do surge https://yourdomain.com but do just surge yourdomain.com. This will disable https redirection.

amaury1093 commented 4 years ago

How about using *.surge.sh domains?

JasCodes commented 4 years ago

Yea.. As long you explicitly don't do surge https://abc.surge.sh but surge abc.surge.sh It won't automatically redirect. Https -> http redirection might not be possible with free account. But you can always ask @sintaxi about it.

sintaxi commented 3 years ago

Sorry I did not get to this earlier. Running surge . http://abc.surge.sh has always worked for forcing http and in the upcoming release of surge you will be able to provide a --force http flag. Let me know if you have any questions.

ramblingenzyme commented 2 years ago

If you have a custom domain without an SSL config/Surge Plus, I think it should force http by default. Otherwise you get a certificate mismatch on the HTTPS version.

sintaxi commented 2 years ago

@ramblingenzyme with surge@edge you can include the force flag in your deployment surge . example.com --force http. This config will remain until it is changed.

ramblingenzyme commented 2 years ago

@sintaxi It's good that that functionality exists, but I would expect that behavior to be default if you are deploying to a custom domain without Surge Plus.