Created
July 14, 2021 12:07
-
-
Save banyudu/fe940a9b1597c8c56aa5aa58bb22ae84 to your computer and use it in GitHub Desktop.
nodejs ipv6 ipv4 test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('http').createServer(function (req, res) { | |
| res.writeHead(200, {'Content-Type': 'text/plain'}); | |
| res.write('Hello ipv4!\n'); | |
| res.end(); | |
| }).listen({ | |
| port: 9999, | |
| host: '127.0.0.1' | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('http').createServer(function (req, res) { | |
| res.writeHead(200, {'Content-Type': 'text/plain'}); | |
| res.write('Hello ipv6!\n'); | |
| res.end(); | |
| }).listen({ | |
| port: 9999, | |
| host: '::1', | |
| ipv6Only: true | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment