question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

passthrough localhost

See original GitHub issue

Is there a way to passthrough requests to localhost?

I am not being able to catch requests to localhost.

server.any().on('request', (req, res) => {
      // it reaches here
      throw new Error('------> here')
});

server.any('http://127.0.0.1*path').on('request', (req, res) => {
      // it never reaches here
      throw new Error('------> here')
});

Hence I cannot do server.any('http://127.0.0.1*path').passthrough()

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

17reactions
claudijocommented, May 18, 2019

An alternative to:

server.any().passthrough(); // Pass-through all requests so they wont get recorded/replayed
server.any('http://example.com').passthrough(false); // Override the pass-through set for the specific host

as described by @offirgolan, if you want to only passthrough requests to 127.0.0.1 with an arbitrary port number and not having to worry about keeping track of what requests you don’t want to passthrough, would be to use server.filter() eg:

 server
      .any()
      .filter(req => /^127.0.0.1:[0-9]+$/.test(req.headers.host))
      .passthrough();
1reaction
ludbekcommented, Feb 22, 2019

It does not work.

Here is the config I am using.

    Polly.register(NodeHttpAdapter);
    Polly.register(FSPersister);

    polly = new Polly('paypal api', {
      persister: 'fs',
      adapters: ['node-http'],
      recordFailedRequests: true,
    });

The recordings have following url.

"url": "http://127.0.0.1:37889/auth/login"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fiddler - letting localhost pass through (not debugging ...
I need to use fiddler to block traffic to a site using autoresponder when working with localhost (as localhost). My question is how...
Read more >
How to configure and/or troubleshoot Passthrough ...
How to configure and/or troubleshoot Passthrough Authentication in ... setting that should be left to default value of localhost).
Read more >
SSH Tunneling: Client Command & Server Configuration
SSH port forwarding is a mechanism in SSH for tunneling application ports from the client machine to the server machine or vice versa....
Read more >
Explore networking features - Docker Documentation
Explore networking features. Docker Desktop provides several networking features to make it easier to use. Features for all platforms . VPN Passthrough...
Read more >
Lesson 5: Passthrough basics | Learn Eleventy From Scratch
This is because our images never got copied over to our dist folder, which is where this localhost:8080 serves the local site from....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found