Skip to content

Commit

Permalink
fix: updated server.js to include the bind IP in the get free port me…
Browse files Browse the repository at this point in the history
…thod
  • Loading branch information
fantinodavide committed Sep 19, 2023
1 parent e7a6abd commit cf72006
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "squad-whitelister",
"version": "1.4.5",
"version": "1.4.6",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
Expand Down
2 changes: 1 addition & 1 deletion release/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "squad-whitelister",
"version": "1.4.5",
"version": "1.4.6",
"dependencies": {
"axios": "^0.26.1",
"body-parser": "^1.20.0",
Expand Down
2 changes: 1 addition & 1 deletion release/server.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3293,7 +3293,7 @@ async function init() {
function get_free_port(checkPort, callback = () => { }, max_port_tries = 15) {
console.log("Looking for free port close to " + checkPort);
try {
fp(checkPort, _tryStart)
fp(checkPort, config.web_server.bind_ip, _tryStart)
} catch (err) { }

let tries = 0;
Expand All @@ -3304,7 +3304,7 @@ async function init() {
let tmpSrv = http.createServer();
let error = false;

await tmpSrv.listen(port).on("error", (e) => {
await tmpSrv.listen(port, config.web_server.bind_ip).on("error", (e) => {
console.error(" > Failed", e.port);
error = true;
let new_try_port = (checkPort == 443 ? 4443 : 8080) + (tries * 100);
Expand Down

0 comments on commit cf72006

Please sign in to comment.