GithubHelp home page GithubHelp logo

Comments (9)

baransu avatar baransu commented on July 28, 2024

Thank for spotting this!
Good solution would be to create some endpoint providing config for UI and then creating WebSocket connection based on that.

from erlangpl.

arkgil avatar arkgil commented on July 28, 2024

I think that sufficient solution would be to allow users to enter hostname and port number to connect to from UI (which would defualt to localhost:8000 of course). If someone wants to change port number we serve content on, if think they would be fine configuring it in UI. What would you think about that @dgulinobw?

from erlangpl.

dgulinobw avatar dgulinobw commented on July 28, 2024

An automated way would be cool, but anything that doesn't involve rebuilding would be sufficient.

from erlangpl.

michalslaski avatar michalslaski commented on July 28, 2024

In the old UI we injected WebSocket port number read from the command line argument into the HTML/JS templates before serving them from cowboy to browsers. Is the same possible after React is built, e.g. can we regexp on "8000" and change it to custom port number?

from erlangpl.

baransu avatar baransu commented on July 28, 2024

Probably yes but it's far from being elegant. And we have also Elm code which can look for port number, we could pass it from React via ports but I don't know. I would go with config endpoint with:

  • port number
  • current version

from erlangpl.

michalslaski avatar michalslaski commented on July 28, 2024

@dgulinobw is port 8000 conflicting with some service, which is running on many operating systems?

The original intention behind having -P flag was to allow users, who have port 8000 occupied by other processes in the system, to decide which port is most suitable for their setup. I can see two options:

  • use port 37575 instead of 8000, hard code it in cowboy/JS/Elm, remove -P flag
  • keep the -P flag, let JS/Elm open WebSocket on the same port as the one found in the URL, from which the UI assets were served - @baransu is that possible?

from erlangpl.

baransu avatar baransu commented on July 28, 2024

I would keep -P flag.

No problem with that. So in production when assets are served by server it will look for port in url and for development it will look for default 8000 when UI is standalone.

from erlangpl.

michalslaski avatar michalslaski commented on July 28, 2024

It seems the port 8000 is a default one for many popular applications like WinAmp and trojans. Maybe it makes sense to have the development port set to 37575.

BTW, try typing on the classic phone with T9 the word "erlpl".

from erlangpl.

baransu avatar baransu commented on July 28, 2024

So let switch to 37575 by default keeping -P flag.

from erlangpl.

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.