Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript web server?

Tags:

javascript

Is it possible to build a micro (proof of concept) web server in Javascript?

Has anyone done this before?.


EDIT: Apparently explicit clarification is needed here. The question is ultimately about how to push data from the server to the browser after the initial request made by the browser has been closed. In other words, how to make the browser accept subsequent requests initiated by a server.

Does a javascript based web server need to be installed into the browser, or is there some other method?

like image 568
skyeagle Avatar asked Nov 20 '10 01:11

skyeagle


2 Answers

Check out the RingoJS project, or Node.js. The answer is "yes", and not just "micro" or "proof of concept".

RingoJS

Node.js

express.js framework for node

edit — This question is extremely old. If you want more information on this topic, it's certainly the case that better resources online have been created over the past 11 years.

like image 95
Pointy Avatar answered Sep 21 '22 09:09

Pointy


If you're saying that you want to be able to push data to browsers that have initiated contact with your server, I'd do some research on Comet servers.

I don't know anything about it, so I'll just pass off a couple links to you that will hopefully point you in the right direction.

From Wikipedia Comet_(programming)

Comet is a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it.1 Comet is an umbrella term, encompassing multiple techniques for achieving this interaction. All these methods rely on features included by default in browsers, such as JavaScript, rather than on non-default plugins. The Comet approach differs from the original model of the web, in which a browser requests a complete web page at a time.[3]

Here's something called APE. I don't know a thing about it, but you may find it helpful.

From the APE site:

APE is a full-featured OpenSource solution designed for Ajax Push. It includes a comet server and a Javascript Framework. APE allows to implement any kind of real-time data streaming to a web browser, without having to install anything on the client-side.

like image 40
user113716 Avatar answered Sep 19 '22 09:09

user113716