Giter Site home page Giter Site logo

Comments (8)

BrianHicks avatar BrianHicks commented on July 28, 2024

hmm, actually, I did a little more searching and I think in the long term we may just want to use the server! But the short-term point still stands.

from elm-watch.

lydell avatar lydell commented on July 28, 2024

Hi! The idea was to use the ELM_WATCH_WEBSOCKET_URL environment variable when you need something dynamic. Have you tried that?

from elm-watch.

lydell avatar lydell commented on July 28, 2024

#87 (comment) would allow this to be dynamic as well.

from elm-watch.

BrianHicks avatar BrianHicks commented on July 28, 2024

Doesn't ELM_WATCH_WEBSOCKET_URL set the same field? How would it make the port dynamic?

from elm-watch.

lydell avatar lydell commented on July 28, 2024

Then I must have failed again understanding exactly what you meant 😅

from elm-watch.

BrianHicks avatar BrianHicks commented on July 28, 2024

ah, ok. Let me add more details then:

  • I have to develop this app through a proxy to make a couple things work right. I'm not up on all the details exactly, but basically app.mycorp-dev.com is my "local" URL.
  • I run something on my computer that overrides that URL, but only for :80 and some other special ports
  • I can get elm-watch working if I set the host to to localhost. Then I don't have to mess with the proxy.
  • At that point, I care a lot about the hostname, but I don't care at all about the port, until…
  • When I make a change, sometimes there is a port conflict and then the whole process supervision scheme crashes and I have to restart it

If I could set a fixed host but a dynamic port, that'd be fine! I don't really care what the port is, just the host.

I admit this is a very specific set of requirements, though. 😆

from elm-watch.

lydell avatar lydell commented on July 28, 2024

Hmm, so is this correct?

  1. Your dev site is on app.mycorp-dev.com
  2. By default elm-watch connects to the same hostname, but you want it to connect to localhost
  3. You can configure the hostname via webSocketUrl, but then you also have to set the port
  4. By default elm-watch gets a free port from the OS, but you have to set the port to a known value so that you can use webSocketUrl, but that sometimes results in a port conflict
  5. So you want to be able to use the hostname but not the port, because you think that would avoid the port conflict?

If so, I’m not sure that would help. When elm-watch gets a free port from the OS, it saves that port in elm-stuff/elm-watch/stuff.json, so it can connect to the same port next time. So I’m thinking you’d get port conflicts anyway?

But with #87 (comment) you’d be able to set a new, free port every time. However, then you end up with old compiled JS trying to connect to the old port, which isn’t ideal. (That’s why elm-watch saves the port it got.)

from elm-watch.

BrianHicks avatar BrianHicks commented on July 28, 2024

Yeah, you've got it. And that makes sense. Hmm. Well, I think this isn't a forever issue; I'm eventually going to have to rework how the processes are spawned and at that point we'll have a better chance to clean up.

I'm going to close this for now since given what you've said the requested change would not fix the problem!

from elm-watch.

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.