-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add sockPath
option (options.sockPath
)
#1289
Conversation
sockPath
option to allow specifying alternatives to /sockjs-node
6f7a301
to
f7eece3
Compare
f7eece3
to
ef580b6
Compare
Codecov Report
@@ Coverage Diff @@
## master #1289 +/- ##
==========================================
+ Coverage 75.72% 78.51% +2.78%
==========================================
Files 5 5
Lines 482 484 +2
Branches 156 158 +2
==========================================
+ Hits 365 380 +15
+ Misses 117 104 -13
Continue to review full report at Codecov.
|
@cheapsteak Does this allow to explicitely set hostname or at least port for socket? I need the socket to connect to a dev server on |
@burtek unfortunately that is not part of this PR I believe you should be able to reference my changes and add additional fields for what you'd need (e.g. |
@cheapsteak got it, thanks for answer |
Also found that I need a way to change the port for sockjs) |
Ah, you don't use inline mode. Otherwise there is already |
The |
The Motivation / Use-Case is spot on here! Thanks @cheapsteak
That part could be a separate PR, but it is also very much needed! The reverse proxy can use a completely different |
What's the status of this PR? |
…with WDS Webpack Dev Server had some bad issues with their websocket for hot reloading setup. They made some assumptions about what the servers base URL, HOST, and PORT and this was *not* configurable by the user. This made the hot reloading features fail hard when used through a proxy like insights-proxy See: webpack/webpack-dev-server#1289 webpack-serve does not have these same issues
…with WDS Webpack Dev Server had some bad issues with their websocket for hot reloading setup. They made some assumptions about what the servers base URL, HOST, and PORT and this was *not* configurable by the user. This made the hot reloading features fail hard when used through a proxy like insights-proxy See: webpack/webpack-dev-server#1289 webpack-serve does not have these same issues
@flyyang I converted the project I am working on to use webpack-serve. That project seemed to do the "right thing" regarding proxied web sockets (for hot reloading) straight out of the box. |
…with WDS Webpack Dev Server had some bad issues with their websocket for hot reloading setup. They made some assumptions about what the servers base URL, HOST, and PORT and this was *not* configurable by the user. This made the hot reloading features fail hard when used through a proxy like insights-proxy See: webpack/webpack-dev-server#1289 webpack-serve does not have these same issues
sockPath
option to allow specifying alternatives to /sockjs-node
sockPath
option (options.sockPath
)
Codecov Report
@@ Coverage Diff @@
## master #1289 +/- ##
==========================================
+ Coverage 75.72% 78.51% +2.78%
==========================================
Files 5 5
Lines 482 484 +2
Branches 156 158 +2
==========================================
+ Hits 365 380 +15
+ Misses 117 104 -13
Continue to review full report at Codecov.
|
Hi what's the status of this PR? Seems like it fell out because I'd be happy to help get it up to date with master and make the changes, host/port, mentioned in this comment. |
That should be very nice too, be able to determine the entire url of the socket, not only the path. |
Need rebase or create new Pr |
@evilebottnawi I've got it up to date in my fork. Don't want to just commandeer this though. Especially without confirmation it'll be accepted. |
Commandeer away! I'll close this PR |
For Bugs and Features; did you add new tests?
Added new tests for addDevServerEntrypoints
I've added examples referenced from #911
I've tested this against the breaking example provided in 2.7.0 and it doesn't suffer the same failure.
Motivation / Use-Case
Similar motivations as #911.
We also have multiple apps being developed behind a reverse proxy (in our case a docker composed nginx). Each app is served from a top-level sub-directory (can't use root path), e.g.
host/app-part-one
,host/app-another-piece
Not sure if v3 fixes this and not sure how long until v3 comes out. This should fix our use case and shouldn't break anything else in the mean time
Breaking Changes
None
Additional Info
It doesn't rely on the
publicPath
value, but unfortunately thesockPath
value has to be passed twice, once in thedevServer
option (this is what Server.js uses to determine what prefix to listen at), and once again in the entry resource url as a query parameter (this is what client/index.js uses to determine where to send requests to)