Giter Site home page Giter Site logo

Comments (4)

dursk avatar dursk commented on September 20, 2024

What's your /etc/hosts look like? I was able to resolve by commenting out

::1	localhost ip6-localhost ip6-loopback

but it's less than desirable...

from pact-mock_service.

bethesque avatar bethesque commented on September 20, 2024

Try setting an explicit --host=0.0.0.0 and --port=1234

from pact-mock_service.

waelemara avatar waelemara commented on September 20, 2024

@dursk I have tried your option, it works, but the mock service is not accessible from outside the container.
@bethesque I have tried your option and it is working as expected, and the mock service is accessible from outside the container.

netstat results after applying both options
Option 1
tcp 0 localhost:1234 0.0.0.0:* LISTEN
Option 2
tcp 0 0 0.0.0.0:1234 0.0.0.0:* LISTEN

ATM the second option is not viable for me as I'm using a wrapper library is there is a way to achieve the same netstat results but without passing --host flag?

I'm already working with the consumer library to have that option open in the API.

Thanks very much and appreciate your time.

from pact-mock_service.

bethesque avatar bethesque commented on September 20, 2024

Neil should be able to get the fix out pretty quickly. The only other option is to do a small hack to the ruby file. Somewhere inside the .net code will be the ruby-standalone package. You'll have to do some exploring because I don't know where that is. Open up pact/lib/vendor/ruby/2.2.0/gems/pact-mock_service-{LATEST_VERSION}/lib/pact/mock_service/cli.rb

Find the line with desc 'start' (about line 52) then find the line method_option :host, aliases: "-h", desc: "Host on which to bind the service", default: 'localhost' Change the 'localhost' to '0.0.0.0'.

I believe the .net impl might actually be using the service command, so change the default in that one too (about line 20).

from pact-mock_service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.