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.

Cannot configure bind address for http/https gateway server

See original GitHub issue

(Note: I reported this on gitter and @kevinswiber suggested I file a bug.)

screen shot 2018-11-13 at 7 11 05 pm

There’s a way to specify the bind address for the admin http server (via admin->hostname in gateway.config.yml) but you can’t currently configure the bind address for the main gateway http/https servers. This is specifically problematic when trying to run in a Docker container where you need it to bind to all interfaces (0.0.0.0) when running in “bridge” network mode, for example.

I took a stab at filing a PR for this. While adding support for the new config value is trivial, the problem I ran into is maintaining backwards compatibility such that folks that currently don’t have the hostname defined get the same behavior (binds to ‘::’ for IPv6, etc), but when I do specify the hostname, the tests break with errors like:

  5) exact host name configuration
       should not serve sub.abc.acme.com :
     TypeError: Cannot read property 'address' of undefined
      at Test.serverAddress (node_modules/supertest/lib/test.js:55:18)
      at new Test (node_modules/supertest/lib/test.js:36:12)
      at Object.obj.(anonymous function) [as get] (node_modules/supertest/index.js:25:14)
      at prepareScenario (test/common/routing.helper.js:16:35)
      at Context.<anonymous> (test/common/routing.helper.js:73:30)

I think this is because node’s net.server.address() returns an object if you don’t specify a hostname (current behavior) or a String if you do (new behavior). (See https://nodejs.org/api/net.html#net_server_address), but I can’t tell if this is just an issue with the tests, or if the rabbit hole goes deeper.

This may be easier than I think and I’m just not familiar with the code base. Any pointers in the right direction so I can file a PR would be much appreciated. Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
XVincentXcommented, Nov 15, 2018

Got it. I’ll try to have a look today or tomorrow. Thanks!

1reaction
bploetzcommented, Nov 14, 2018

@XVincentX yup, will push that up when I get to work in a couple hours. Stay tuned…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Configure Bind as a Caching or Forwarding DNS ...
In this guide, we will discuss how to install and configure the Bind9 DNS server as a caching or forwarding DNS server on...
Read more >
Cannot access Gateway URI by IP address if servername is ...
Problem. When we access Gateway URI through IP address we are re-prompted for login window if the server name is mentioned in IBM...
Read more >
Configuring IP Passthrough and DMZplus - AT&T
Open a browser on a computer that is directly connected to the gateway. In the address bar, enter http://192.168.1.254. Select the Firewall tab...
Read more >
Blank default gateway may occur after configuring Static IP ...
This article provides a solution to an issue where blank default gateway may occur after you configure Static IP address following network ...
Read more >
Allow specific IP addresses access to an API Gateway REST API
Then, run another test from an environment without an allowed IP address to confirm that your REST API returns an HTTP 403 Forbidden...
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