You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 30, 2023. It is now read-only.
Change the last line to console.log(server.port, 'Ready.');
Run it passing 0 (random port), and see that server.port returns 0 and not the port its bound to.
Which operating system are you using?
Linux
Did you use binary PhantomJS or did you compile it from source?
Binary
Please provide any additional information below.
I wrote a patch I'm currently fashioning into a PR, which will reference this issue as requested in the CONTRIBUTING file.
Assigning a random port comes in handy if you're managing a bunch of phantom instances on one machine. Using 0 is the only race-condition-proof way of assigning a random port, as far as I know.
Here's a case where someone is working around the issue in a pretty heinous way that I didn't want to duplicate in my project:
What version?
2.1.1
What steps will reproduce the problem?
Which operating system are you using?
Linux
Did you use binary PhantomJS or did you compile it from source?
Binary
Please provide any additional information below.
I wrote a patch I'm currently fashioning into a PR, which will reference this issue as requested in the CONTRIBUTING file.
Assigning a random port comes in handy if you're managing a bunch of phantom instances on one machine. Using 0 is the only race-condition-proof way of assigning a random port, as far as I know.
Here's a case where someone is working around the issue in a pretty heinous way that I didn't want to duplicate in my project:
The text was updated successfully, but these errors were encountered: