Comments (8)
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.
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.
#87 (comment) would allow this to be dynamic as well.
from elm-watch.
Doesn't ELM_WATCH_WEBSOCKET_URL
set the same field? How would it make the port dynamic?
from elm-watch.
Then I must have failed again understanding exactly what you meant 😅
from elm-watch.
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 tolocalhost
. 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.
Hmm, so is this correct?
- Your dev site is on
app.mycorp-dev.com
- By default elm-watch connects to the same hostname, but you want it to connect to
localhost
- You can configure the hostname via
webSocketUrl
, but then you also have to set the port - 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 - 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.
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)
- source-directories with big ancestor directory → file watcher error HOT 2
- Running 'example-minimal' in devcontainer wsl2 - not picking up changes to *.elm HOT 2
- Runtime error after build with --optimize HOT 10
- Getting the error `Error: spawn Unknown system error -8` when using Node 18 HOT 9
- Allow overriding the output file for a target HOT 6
- Allow building a file with the hot-reload code inserted HOT 1
- File changes made don't trigger hot reload - WSL2
- RFC: Overhaul HTTPS support HOT 13
- how would you use elm-optimize-level-2 with elm-watch? HOT 2
- Command line is too long error HOT 1
- dynamically specifying output location HOT 6
- Add output to postprocess arguments HOT 2
- Permission denied when running as root HOT 2
- elm-watch hangs on error HOT 6
- watching through symlinks HOT 1
- elm-watch hangs on error in dependency stage HOT 5
- The port showing as "0" (http://localhost:0) in the terminal when elm-watch is concatenated with the "cat" command
- errors display below <dialog>s HOT 3
- Broken link in the docs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-watch.