var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end("Hello world\n") }).listen(8000, '0.0.0.0'); console.log('Server started')
# nodejs helloworld.js # curl localhost:8000
var net=require('net') net.createServer(function(socket) { socket.write("Echo Server....\n") socket.on('data', function(data) { socket.write(data.toString()) }) }).listen(8000, 'localhost')
# nc localhost 8000 Echo Server.... Hello World Hello World Ok Ok
Copyrights © - Joinc, All Rights Reserved. Inherited From - Yundream Rebranded By - Joonphil
Hello World HTTP 서버
Echo 서버
Chat 서버
Recent Posts
Archive Posts
Tags