Skip to content

Commit

Permalink
Release 4.0.0: upgrade from opn@6 to open@7, require Node 16
Browse files Browse the repository at this point in the history
Upgrade grunt-contrib-internal from 6 to 8, which
updates CI from Node 10,12,14 to Node 14,16,18,20.

Fix default connect() hostname to work on Node 18+, where otherwise
CI fails as follows:

> Running "nodeunit:tests" (nodeunit) task
> Testing connect_test.jsFatal error: connect ECONNREFUSED ::1:8000
> Error: connect ECONNREFUSED ::1:8000
>  at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)

Previously, grunt-contrib-connect was passing empty string or null
down to `connect(,hostname)` to leave the default implicitly handled
by `connect` and Node's built-in `http.Server` class. Then, later,
it was doing a fallback to `0.0.0.0` but this only affected the CLI
output text, not the value passed to `connect()`.

Node 17+ changed per nodejs/node#40702 to
prefer IPv6 loopback when available (`::`) instead of IPv4 loopback
(`0.0.0.0`), unless `0.0.0.0` is explicitly passed.

This was fixed in Node 20, with `http.get` underlying `net` TCP module
implementing "Happy Eyeballs" (same as browsers and curl) which
basically means trying both IPv6 and IPv4. nodejs/node#44731

The workaround is to call `dns.setDefaultResultOrder('ipv4first')`
which ensures that the first try is over IPv4 instead of IPv6.
  • Loading branch information
Krinkle committed Jul 13, 2023
1 parent 7658372 commit 4494744
Show file tree
Hide file tree
Showing 7 changed files with 8,680 additions and 2,156 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Tests

on: [push, pull_request]
on:
push:
branches:
- "**"
- "!dependabot/**"
pull_request:
workflow_dispatch:

env:
FORCE_COLOR: 2
Expand All @@ -13,15 +19,17 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12, 14]
os: [ubuntu-latest, windows-latest]
node: [14, 16, 18, 20]

steps:
- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v4.0.0:
date: 2023-07-13
changes:
- Requires node 16+.
- Updated dependencies.
v3.0.0:
date: 2020-07-16
changes:
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# grunt-contrib-connect v3.0.0 [![Build Status](https://github.com/gruntjs/grunt-contrib-connect/workflows/Tests/badge.svg)](https://github.com/gruntjs/grunt-contrib-connect/actions?workflow=Tests)
# grunt-contrib-connect v4.0.0 [![Build Status](https://github.com/gruntjs/grunt-contrib-connect/workflows/Tests/badge.svg)](https://github.com/gruntjs/grunt-contrib-connect/actions?workflow=Tests)

> Start a connect web server
Expand Down Expand Up @@ -380,6 +380,7 @@ grunt.registerTask('jasmine-server', 'start web server for jasmine tests in brow

## Release History

* 2023-07-13   v4.0.0   Requires node 16+. Updated dependencies.
* 2020-07-16   v3.0.0   Requires node 10+. Updated dependencies.
* 2019-09-03   v2.1.0   Update package lock. Allow all configuration options of livereload to be passed through.
* 2018-09-09   v2.0.0   Drop Node.js < 6 support. Update all dependencies and switch to `node-http2`. Add `secureProtocol` in `httpsOptions`. Fix `open.appName`. Allow passing `serve-index` options.
Expand Down Expand Up @@ -412,4 +413,4 @@ grunt.registerTask('jasmine-server', 'start web server for jasmine tests in brow

Task submitted by ["Cowboy" Ben Alman](http://benalman.com)

*This file was generated on Thu Jul 16 2020 10:58:04.*
*This is a generated file.*
Loading

0 comments on commit 4494744

Please sign in to comment.