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: Use local port to avoid triggering the firewall #1833

Merged
merged 1 commit into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/firefox/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ export async function connectWithMaxRetries(
export function findFreeTcpPort(): Promise<number> {
return new Promise((resolve) => {
const srv = net.createServer();
// $FLOW_FIXME: flow has his own opinions on this method signature.
srv.listen(0, () => {
// $FLOW_FIXME: signature for listen() is missing - see https://github.com/facebook/flow/pull/8290
srv.listen(0, '127.0.0.1', () => {
const freeTcpPort = srv.address().port;
srv.close(() => resolve(freeTcpPort));
});
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/fake-amo-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ http.createServer(function(req, res) {
} else {
process.exit(1);
}
}).listen(8989, () => {
}).listen(8989, '127.0.0.1', () => {
process.stdout.write('listening');
process.stdout.uncork();
});
2 changes: 1 addition & 1 deletion tests/functional/fake-firefox-binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ net.createServer(function(socket) {
});

socket.write(toRDP(REPLY_INITIAL));
}).listen(getPortFromArgs());
}).listen(getPortFromArgs(), '127.0.0.1');
3 changes: 2 additions & 1 deletion tests/unit/test-firefox/test.remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ describe('firefox.remote', () => {
async function promiseServerOnPort(port): Promise<net.Server> {
return new Promise((resolve) => {
const srv = net.createServer();
srv.listen(port, () => {
// $FLOW_FIXME: signature for listen() is missing - see https://github.com/facebook/flow/pull/8290
srv.listen(port, '127.0.0.1', () => {
resolve(srv);
});
});
Expand Down