Commands on server/node console:
```
[root@alfredo-2 /usr/:~/src/freebsd-ports/www/node] # node
Welcome to Node.js v12.10.011.1.
Type ".help" for more information.
> var http = require('http');
undefined
> http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Node.js World!'); }).listen(8080);
... res.writeHead(200, {'Content-Type': 'text/plain'});
... res.end('Hello Node.js World!');
... }).listen(8080);
Server {
_events: [Object: null prototype] {
request: [Function],
connection: [Function: connectionListener]
},
_eventsCount: 2,
_maxListeners: undefined,
_connections: 0,
_handle: TCP {
reading: false,
onconnection: [Function: onconnection],
[Symbol(owner)]: [Circular]
},
_usingWorkers: false,
_workers: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 120000,
keepAliveTimeout: 5000,
maxHeadersCount: null,
headersTimeout: 40000,
_connectionKey: '6::::8080',
[Symbol(IncomingMessage)]: [Function: IncomingMessage],
[Symbol(ServerResponse)]: [Function: ServerResponse],
[Symbol(asyncId)]: 22309
}
>
```
From client:
```
[root@alfredo-2 /usr/ports/www/node]# curl http://localhost:8080 -v
Hello Node.js World![root@alfredo-2 /usr/ports/www/node]# curl -v http://localhost:8080* Trying 127.0.0.1:8080...
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.64.166.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: text/plain
< Date: TueMon, 10 Sep21 Oct 2019 18:59:4821:43:27 GMT
< Connection: keep-alive
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
Hello Node.js World!* Closing connection 0
```