Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect http traffic to https when listening on https protocol #2517

Closed
1 of 2 tasks
axos88 opened this issue Apr 14, 2020 · 2 comments
Closed
1 of 2 tasks

Redirect http traffic to https when listening on https protocol #2517

axos88 opened this issue Apr 14, 2020 · 2 comments

Comments

@axos88
Copy link

axos88 commented Apr 14, 2020

  • Operating System: n/a

  • Node Version: 10.20.1

  • NPM Version: 6.14.4

  • webpack Version: 4.41.2

  • webpack-dev-server Version: 3.9.0

  • Browser: chrome, but not really important.

  • This is a bug

  • This is a modification request

Expected Behavior

When listening on https protocol, any received http traffic should be (optionally) redirected to https, or handled without initiating an ssl context.

Actual Behavior

Connection is closed prematurely. One needs to type in https://localhost:4200 manually instead, which is not automatically saved into the quicksearch bar of chrome.

For Features; What is the motivation and/or use-case for the feature?

When developing an application locally, typing in say localhost:4200 into the address bar opens a connection using http protocol by default, and chrome returns an ERR_EMPTY_RESPONSE error, wihtout trying to connect using https.

A 302 response to the same endpoint with https protocol would take care of this issue.

A most simple implementation would take a look at the first few bytes of the incoming stream before initiating the ssl context and if it equals GET, it would handle the connection in a special manner, returning a 302.

@alexander-akait
Copy link
Member

Sounds good, but we need additional server on http for that, related #126

@alexander-akait
Copy link
Member

Let's close in favor #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants