2018/12
Node.js 기본 코드 2 TCP Server Client
Node.js 기본 코드 2 TCP Server Client
2018.12.06참고 URL : http://ourcstory.tistory.com/67?category=664896 TCP_SERVER.JS /** * http://usejsdoc.org/ */ // http://ourcstory.tistory.com/67?category=664896 var net = require('net'); var server = net.createServer(function(socket){ console.log(socket.address().address + " connected."); // client request socket.on('data', function(data) { console.log('rcv:'+data) }); // client disconnect socket.on('clo..
Node.js 기본 코드
Node.js 기본 코드
2018.12.04참고 블로그: - http://ourcstory.tistory.com/66?category=664896 var http = require('http');http.createServer(function handler(req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.end('Hello World\n');}).listen(1337, '127.0.0.1');console.log('Server running at http://127.0.0.1:1337/'); /* OS 관련 테스트 */var os = require('os');console.log(os.hostname());console.log(os.type());console.log(os.p..