D
D
dhdfshs2018-09-26 23:08:46
Programming languages
dhdfshs, 2018-09-26 23:08:46

In what languages, how can I open a port on a node by creating a network application?

In a node, you can create a server application on a specific port in a couple of lines

var http = require('http');
http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.write(req.url);
    res.end();
}).listen(8080);

Such an application will be able to receive a huge number of requests.
In PHP, this is not realistic to depict (or am I wrong?).
In what languages ​​is it also easy to open a port and write logic so that a network application can withstand heavy loads of min. 1000 connections per second?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2018-09-27
@saboteur_kiev

In php this can be done in one line

файл: test.php
<?php echo "<p>Welcome to PHP</p>"; ?>

Запустить  его 
php -S localhost:80 test.php

In general, you are confusing the language and the ready-made built-in library for the web server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question