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

confirm ::1 address works #355

Merged
merged 2 commits into from
Feb 24, 2023
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ jobs:
- name: Run json-server test
run: npm run demo-json-server

- name: Run ::1 host example
run: npm run demo-ip6

release:
needs: ['tests1', 'tests2', 'tests-node-v18']
if: github.ref == 'refs/heads/master'
Expand Down
13 changes: 7 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@
"demo-commands": "node src/bin/start.js 'node test/server.js --port 8800' 8800 'node test/client --port 8800'",
"demo-multiple": "node src/bin/start.js 'node test/server --port 6000' 6000 'node test/server --port 6010' 6010 'curl http://127.0.0.1:6000 && curl http://127.0.0.1:6010'",
"demo-multiple-test-commands": "node src/bin/start.js 9000 'npm run message && npm run message2'",
"demo-json-server": "node src/bin/start.js 'json-server test/data.json' 3000 'echo json-server working'"
"demo-json-server": "node src/bin/start.js 'json-server test/data.json' 3000 'echo json-server working'",
"demo-ip6": "node src/bin/start.js 'node test/ip6.mjs' 8000 'echo server with ::1 working'"
},
"devDependencies": {
"@types/node": "^18.14.1",
"ban-sensitive-files": "1.9.7",
"chai": "4.2.0",
"cross-env": "7.0.2",
Expand Down
17 changes: 17 additions & 0 deletions test/ip6.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import http from 'node:http';

// Create a local server to receive data from
const server = http.createServer();

// Listen to the request event
server.on('request', (request, res) => {
console.log('server responding')
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
data: 'Hello World!',
}));
});

server.listen(8000, '::1', () => {
console.log('server is listening on ::1:8000')
});