4 edited body
source | link

NodeJS, 146 134 126127 bytes

require('http').createServer((q,s)=>s.end(eval(0+q.socket.remoteAddress.replace(/^.*:|\./g,'+'))+'\n')).listen(process.argv[2])

I finally get to post a NodeJS answer! IPv4 only right now.

Sample execution: node script.js 1024. From another terminal:

$ curl 127.0.0.1:1024
128

NodeJS, 146 134 126 bytes

require('http').createServer((q,s)=>s.end(eval(0+q.socket.remoteAddress.replace(/^.*:|\./g,'+'))+'\n')).listen(process.argv[2])

I finally get to post a NodeJS answer! IPv4 only right now.

Sample execution: node script.js 1024. From another terminal:

$ curl 127.0.0.1:1024
128

NodeJS, 146 134 127 bytes

require('http').createServer((q,s)=>s.end(eval(0+q.socket.remoteAddress.replace(/^.*:|\./g,'+'))+'\n')).listen(process.argv[2])

I finally get to post a NodeJS answer! IPv4 only right now.

Sample execution: node script.js 1024. From another terminal:

$ curl 127.0.0.1:1024
128
3 added 3 characters in body
source | link

NodeJS, 146 134134 126 bytes

require('http').createServer(function(q,s){s=>s.end(eval(0+q.socket.remoteAddress.replace(/^.*:|\./g,'+'))+'\n')}).listen(process.argv[2])

I finally get to post a NodeJS answer! IPv4 only right now.

Sample execution: node script.js 1024. From another terminal:

$ curl 127.0.0.1:1024
128

NodeJS, 146 134 bytes

require('http').createServer(function(q,s){s.end(eval(0+q.socket.remoteAddress.replace(/^.*:|\./g,'+'))+'\n')}).listen(process.argv[2])

I finally get to post a NodeJS answer! IPv4 only right now.

Sample execution: node script.js 1024. From another terminal:

$ curl 127.0.0.1:1024
128

NodeJS, 146 134 126 bytes

require('http').createServer((q,s)=>s.end(eval(0+q.socket.remoteAddress.replace(/^.*:|\./g,'+'))+'\n')).listen(process.argv[2])

I finally get to post a NodeJS answer! IPv4 only right now.

Sample execution: node script.js 1024. From another terminal:

$ curl 127.0.0.1:1024
128
2 deleted 1 character in body
source | link

NodeJS, 146146 134 bytes

require('http').createServer(function(q,s){s.end(eval(q0+q.socket.remoteAddress.replace(/^.*:/,'').replace(/\|\./g,'+'))+'\n')}).listen(process.argv[2])

I finally get to post a NodeJS answer! IPv4 only right now.

Sample execution: node script.js 1024. From another terminal:

$ curl 127.0.0.1:1024
128

NodeJS, 146 bytes

require('http').createServer(function(q,s){s.end(eval(q.socket.remoteAddress.replace(/^.*:/,'').replace(/\./g,'+'))+'\n')}).listen(process.argv[2])

I finally get to post a NodeJS answer! IPv4 only right now.

Sample execution: node script.js 1024. From another terminal:

$ curl 127.0.0.1:1024
128

NodeJS, 146 134 bytes

require('http').createServer(function(q,s){s.end(eval(0+q.socket.remoteAddress.replace(/^.*:|\./g,'+'))+'\n')}).listen(process.argv[2])

I finally get to post a NodeJS answer! IPv4 only right now.

Sample execution: node script.js 1024. From another terminal:

$ curl 127.0.0.1:1024
128
1
source | link