Skip to content

Commit

Permalink
Merge pull request #13 from sjrd/fix-node-js-17
Browse files Browse the repository at this point in the history
Fix #12: Force the server and client of Node.js Com to use IPv4.
  • Loading branch information
sjrd authored Nov 2, 2021
2 parents f0dc9bd + c27f0b7 commit 625e290
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 625e290

Please sign in to comment.