×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I'm not an expert, but I seem to recollect a web sockets example using
node.js where it built it's own web server and it didn't seem to be a lot
of code.
var http = require("http");
var url = require("url");
function start() {
function onRequest(request, response) {
var pathname = url.parse(request.url).pathname;
console.log("Request for " + pathname + " received.");
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}
http.createServer(onRequest).listen(8888);
console.log("Server has started.");
}
exports.start = start;
---
A tutorial would explain it. But you're right. There isn't a need for a lot
of code to create an HTTP server, which is somewhat different than a Web
socket server. And that's part of the appeal of the language / runtime
environment.
That example both creates an HTTP server instance for handling the sockets
and protocol, and responds with simple content.
Nathan.
As an Amazon Associate we earn from qualifying purchases.