Fixed ipv4 host binding and sockjs proxy exclusion #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
After initial setup of the plugin I ran into some bugs.
The first bug I identified was the fact that the express server was not binding correctly.
The second being the fact that sockjs was being proxied to the express server even though it should not. While I am not certain I believe sockjs is used for communication between the frontend and devServer.
Both can be seen in the image below.
Host Binding Fix
Looking at the the server.listen() definition we can see that the default behavior is to bind to ipv6 if enabled. Propagating the host variable to the function call fixed this issue.
Proxy Sockjs Fix
I did not find an easy way to exclude paths in the proxy definition so I opted to create a proxy spec for each route that should be proxied to the express server. This was done by saving the express routes information in parallel with the serverUrl information.
Result
Thanks for the plugin!