diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05a925c..2e9e769 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,24 @@ jobs: strategy: fail-fast: false matrix: + nodejsversion: ["15"] scalaversion: ["2.11.12", "2.12.11", "2.13.2"] project: ["scalajs-js-envs", "scalajs-js-envs-test-kit", "scalajs-env-nodejs"] + include: + - nodejsversion: "16" + scalaversion: "2.12.11" + project: "scalajs-env-nodejs" + - nodejsversion: "17" + scalaversion: "2.12.11" + project: "scalajs-env-nodejs" steps: - uses: actions/checkout@v2 - uses: olafurpg/setup-scala@v10 with: java-version: "adopt@1.8" + - uses: actions/setup-node@v2 + with: + node-version: "${{ matrix.nodejsversion }}" - uses: coursier/cache-action@v5 - name: Test run: sbt "++${{ matrix.scalaversion }}" ${{ matrix.project }}/test diff --git a/nodejs-env/src/main/scala/org/scalajs/jsenv/nodejs/ComSupport.scala b/nodejs-env/src/main/scala/org/scalajs/jsenv/nodejs/ComSupport.scala index 31b514f..bef71ec 100644 --- a/nodejs-env/src/main/scala/org/scalajs/jsenv/nodejs/ComSupport.scala +++ b/nodejs-env/src/main/scala/org/scalajs/jsenv/nodejs/ComSupport.scala @@ -209,7 +209,7 @@ object ComRun { def start(config: RunConfig, onMessage: String => Unit)(startRun: Path => JSRun): JSComRun = { try { val serverSocket = - new ServerSocket(0, 0, InetAddress.getByName(null)) // Loopback address + new ServerSocket(0, 0, InetAddress.getByName("127.0.0.1")) // IPv4 loopback address val run = startRun(setupFile(serverSocket.getLocalPort)) @@ -248,7 +248,7 @@ object ComRun { s""" |(function() { | // The socket for communication - | var socket = require('net').connect($port); + | var socket = require('net').connect($port, '127.0.0.1'); // IPv4 loopback address | | // Buffers received data | var inBuffer = Buffer.alloc(0);