[x3d-public] python, node web servers listen on all interfaces
John Carlson
yottzumm at gmail.com
Sat Apr 16 18:07:28 PDT 2016
With node/express, you can configure the web server to listen on localhost only:
var express = require('express');
var app = express();
var port = process.env.PORT || 3000;
app.listen(port, 'localhost');
$ netstat -nat|grep LISTEN
tcp4 0 0 127.0.0.1.3000 *.* LISTEN
Anyone have a similar recipe for python?
> On Apr 16, 2016, at 8:58 PM, John Carlson <yottzumm at gmail.com> wrote:
>
> Just a note to follow up:
>
> node and python web servers listen on all interfaces without careful setup. Thus you shouldn’t start a node or python web server without looking
> carefully looking at how to configure it for localhost only.
>
> $ python3 -m http.server
> Serving HTTP on 0.0.0.0 port 8000 ...
> ^Z
> [1]+ Stopped python3 -m http.server
> coderextreme:X3DJSONLD johncarlson$ netstat -nat|grep LISTEN
> tcp4 0 0 *.8000 *.* LISTEN
>
> $ node app.js &
> [1] 11460
> coderextreme:X3DJSONLD johncarlson$ listening on http://localhost:3000 <http://localhost:3000/>
> Go to the link above!
>
> !net
> netstat -nat|grep LISTEN
> tcp46 0 0 *.3000 *.* LISTEN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160416/9c447af8/attachment.html>
More information about the x3d-public
mailing list