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 #12: Force the server and client of Node.js Com to use IPv4. #13

Merged
merged 1 commit into from
Nov 2, 2021
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
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