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

Failed to load resource: The network connection was lost. #65

Closed
flippyhead opened this issue Feb 25, 2016 · 2 comments
Closed

Failed to load resource: The network connection was lost. #65

flippyhead opened this issue Feb 25, 2016 · 2 comments

Comments

@flippyhead
Copy link

I've got a basic HTTP/HTTPS proxy running:

var Proxy = require('http-mitm-proxy');
var proxy = Proxy();

proxy.onError( (ctx, err, errorKind) => {
  var url = (ctx && ctx.clientToProxyRequest) ? ctx.clientToProxyRequest.url : '';
  console.error(errorKind + ' on ' + url + ':', err);
});

proxy.use(Proxy.gunzip);

proxy.listen({port: 8089, sslCaDir: "/Users/peter/Development/fetching-proxy/certs"});

I notice that Safari (possibly other browsers) frequently show this kind of error in the console for JS and CSS assets:

Failed to load resource: The network connection was lost.

I'm not sure they are related, but the node console also has many:

HTTPS_CLIENT_ERROR on : { [Error: socket hang up] code: 'ECONNRESET' }

and

PROXY_TO_SERVER_REQUEST_ERROR on /510080801/: { [Error: connect ETIMEDOUT 31.13.85.8:443]

Needless to say this causes most websites to have trouble loading.

Thank you!

@felicienfrancois
Copy link
Collaborator

Thank you for this report.

Personally, i sometimes have thoose errors on Safari even without proxy. Safari probably have a low request timeout and cancel too long requests before the end.

With the proxy, the request takes inevitably longer to be answered and so the rate of cancelled request is higher.

But they are still areas for improvement.
We're currently working on a few:

  • Start only one internal HTTPS Server instead of one per host. Pushed yesterday, you can enable this on HEAD using forceSNI option)
  • Generate wilcard certificates by default in order to generate less certificates (WIP)
  • Enable HTTP/2 support (WIP)

But there are a lot more things we could do.
Any help is welcomed to:

  • Discuss about areas for improvement
  • Benchmark / Test / Identify the perf issues
  • Fix issues (PR welcome)
  • Update documentation (PR welcome)

@felicienfrancois
Copy link
Collaborator

Here another discussion about performance: #39

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

No branches or pull requests

2 participants