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.

Invalid request call when hapi host is set to 0.0.0.0

See original GitHub issue

Context

  • hapi-swgger version: 9.0.2
  • any other relevant information: Hapi 17.2.0

What are you trying to achieve or the steps to reproduce ?

I want to run hapi server on all my network interfaces (NIC) so I’m using following host: 0.0.0.0. While Swagger UI is displayed correctly, request executed through it does not work because it is invoked against host taken from Hapi configuration - 0.0.0.0.

const server = new Hapi.Server({
    host: '0.0.0.0',
    port: 8083
});

What result did you get?

When I execute swagger request when I’m connected from whatever domain eg. http://192.168.0.55:8083/api/docs (NIC 1) or http://internal.domain.com:8083/api/docs (the same NIC 1) or http://my.public.domain.com:8083/api/docs (NIC 2) http:/123.123.123.123:8083/api/docs (the same NIC 2)

all requests are executed as http://0.0.0.0:8083/api/config

What did you expect ?

host for building request url should be taken directly from the browser - not Hapi configuration

It worked properly in hapi-swagger v8 and now it is broken

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
robmcguinnesscommented, Nov 7, 2018

@mattboutet i’ll release today or tomorrow. let me try and squeeze in a unit test for this feature.

0reactions
mattboutetcommented, Nov 7, 2018

#537 Fixes this issue for my use case - I’d love to see that get merged so I can scrap my fork of hapi-swagger.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid request call when hapi host is set to 0.0.0.0 · Issue #497
I want to run hapi server on all my network interfaces (NIC) so I'm using following host: 0.0.0.0 . While Swagger UI is...
Read more >
21.1.0 API Reference - hapi.dev
The server manages all incoming requests along with all the facilities provided by ... Sets the minimum response payload size in bytes that...
Read more >
Unable to access the web server when dockerising the Hapi JS
I am trying to dockerise my application. But it is not working. I first set up npm for the project running the following...
Read more >
Getting Started with Server-Side Development with Hapi.js
host is set to '0.0.0.0 ' to listen for request from all IP addresses. And then to create a route, we call the...
Read more >
Kibana : Internal Server Error - #5 by sanju_timsina
_execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:221:9) ... [info][server][Kibana][http] http server running at http://0.0.0.0:5601 log ...
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