Coder Social home page Coder Social logo

Comments (6)

marcosnils avatar marcosnils commented on May 23, 2024 1

Was there a change in the NAT behaviour?

Yes, we forgot to add something, just re-applied it and I'm getting the same error as you. I'll investigate and check what can be done. Thx for reportiing!.

from play-with-docker.

marcosnils avatar marcosnils commented on May 23, 2024

@cookiengineer what did you run in the container?. As running some other basic apps doesn't add the Allow-Origin header. I'm wondering if whatever you're running in PWD might be causing this.

Is there a way I can easily reproduce?

from play-with-docker.

cookiengineer avatar cookiengineer commented on May 23, 2024

I'm not sure if that's an easy way to reproduce, but you can use the same docker command as I tried out with the lycheejs container:

Steps to reproduce:

$ docker run --publish 4848:4848 --publish 8080:8080 cookiengineer/lycheejs
  1. Go to the port 8080 and its Welcome Page.
  2. Inspect Network Tab, scroll down to index request of :4848/api/project/index

It still is broken but it seems to behave differently now on my other machine (I guess older Chrome Version 56.0.2924.87, will update and report back), despite having nothing changed in the docker image. Was there a change in the NAT behaviour? The container and the software inside runs under the assumption that there are two public ports, 8080 and 4848, reachable under the same host. 8080 can be modified to whatever port, but 4848 has to be there as it serves the public API.

I see that the concept of play-with-docker tries to map published ports to different hostnames, so I guess that's why the request to somethingrandom-8080...:4848 caused the trouble in the first place? That CORS request to 4848 was the one that failed.

You can try it out in the container via GET thehost-4848.play-with-docker.com:4848/api/project/index and it will work. And the request of GET thehost-8080.play-with-docker.com:4848/api/project/index was the one with the CORS Header problems.

So I'm not sure whether this is a problem by concept or not.

Is there a way to publish all ports on the same host in play-with-docker or wouldn't that be possible as its focus is single-port-per-container only?

from play-with-docker.

cookiengineer avatar cookiengineer commented on May 23, 2024

Awesome, just let me know where I can help :)

from play-with-docker.

marcosnils avatar marcosnils commented on May 23, 2024

@cookiengineer just deployed a version that fixes this. Can you please give it a try and close if it works?

Thx!.

from play-with-docker.

cookiengineer avatar cookiengineer commented on May 23, 2024

Awesome! Tested and verified, works like a charm!

from play-with-docker.

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.