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

Option to set the local network interface #47

Closed
patrickjane opened this issue May 16, 2018 · 7 comments
Closed

Option to set the local network interface #47

patrickjane opened this issue May 16, 2018 · 7 comments

Comments

@patrickjane
Copy link

patrickjane commented May 16, 2018

I could not find any information about network interface binding for outgoing requests. This would be necessary for my project, however, since the customers firewall will not allow connections from all interfaces of the host.
To be precise, request module's localAddress option would be needed.

Is there a way to work around this issue?

@s-KaiNet
Copy link
Owner

I can't see any easy way to do that, apart adding a new parameter to the getAuth method, which is not very convenient.

Have you tried node-sp-auth with localAddress setup? Does it work for you?

@patrickjane
Copy link
Author

What do you mean with "localAddress setup"?

@s-KaiNet
Copy link
Owner

I mean do you have working proof-of-concept for node-sp-auth and request module's localAddress provided? In other words are you sure that node-sp-auth works well for you with localAddress specified?

@patrickjane
Copy link
Author

No I don't. I was just asking for a way to have all network actions of your library bind to a specific local address :) This is done in the request module by specifying the localAddress option. If the request module is the only way of network communication you have, then it should be sufficient.
However I did not check your code, and you're the author of the code, so you should probably know if there is more to be done.

@s-KaiNet
Copy link
Owner

I've published 2.5.0 version. Now you can configure request module, used in node-sp-auth with below code:

spauth.setup({
        requestOptions: {
          headers: {
            'my-test-header': 'my value'
          },
          localAddress: '123',
          ...
        }
      });

You should run setup before running getAuth method. Please try it and say if it works for you.

@patrickjane
Copy link
Author

Thanks for the follow up, I have updated the module and did some tests, everything seems to work fine.

I appreciate your work, its a great and really easy to use lib which works really well. Thumbs up 👍

@s-KaiNet
Copy link
Owner

thanks, glad it helps! Closing

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