Skip to content
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

fix: user server port for websocket connection by default #3185

Merged
merged 4 commits into from Apr 29, 2021

Conversation

alexander-akait
Copy link
Member

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

bugfix/refactor

Motivation / Use-Case

webpack/webpack-cli#2624

Breaking Changes

No

Additional Info

Need test

anshumanv
anshumanv previously approved these changes Apr 14, 2021
snitin315
snitin315 previously approved these changes Apr 14, 2021
@alexander-akait
Copy link
Member Author

Hope we don't break anything, proxy is really difficult cases, here possible values

  • proxy by hostname, dev server is 0.0.0.0:8081 (port can be any due findPort), proxy on my.site:8081, no problems because port is the same, 0.0.0.0 can be changed on self.locations.hostname
  • proxy by hostname and port, dev server is 0.0.0.0:8081 (port can be any due findPort), proxy on my.site:9091, after this PR we should not have problems because we set 8081 port for client entry

@codecov
Copy link

codecov bot commented Apr 14, 2021

Codecov Report

Merging #3185 (d9bba52) into master (c4279c2) will increase coverage by 0.37%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3185      +/-   ##
==========================================
+ Coverage   95.03%   95.41%   +0.37%     
==========================================
  Files          38       37       -1     
  Lines        1249     1242       -7     
  Branches      350      347       -3     
==========================================
- Hits         1187     1185       -2     
+ Misses         56       51       -5     
  Partials        6        6              
Impacted Files Coverage Δ
lib/Server.js 95.10% <ø> (+0.96%) ⬆️
lib/utils/DevServerPlugin.js 98.75% <100.00%> (ø)
lib/utils/findPort.js 100.00% <0.00%> (ø)
lib/utils/defaultTo.js
lib/utils/runBonjour.js 80.00% <0.00%> (+5.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4279c2...d9bba52. Read the comment docs.

@alexander-akait
Copy link
Member Author

Possible cases for tests:

  • different hostnames and different ports, example - proxy on site.loc and port is 9090, dev server on 127.0.0.1 and port is 8080
  • different hostnames and same ports, example - proxy on site.loc and port is 8080, dev server on 127.0.0.1 and port is 8080
  • same hostnames and different ports, example - proxy on 127.0.0.1 and port is 9090, dev server on 127.0.0.1 and port is 8080
  • same hostnames and same ports, impossible

@alexander-akait
Copy link
Member Author

hm, I need time for better testing this

@alexander-akait
Copy link
Member Author

Finished...

@alexander-akait alexander-akait merged commit 0c3f817 into master Apr 29, 2021
@alexander-akait alexander-akait deleted the fix-use-server-port-for-client-by-default branch April 29, 2021 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants