Git Product home page Git Product logo

was's Introduction

#Websocket Application Server (WAS)# ###using node.JS and PHP###

WAS is a webserver with support of websockets and a mature scripting language. Currently it supports PHP. There is also rudimentry support for Perl, Ruby and Python, but as yet without POST support.

The general idear is that all should be run on the same server and from one port (80 /443)

Install it, run the server and browse the example application.

###This stack consists of:###

  • node.js: An event-based experimental server written in JavaScript and using googles V8 engine.
  • express module: HTML static file server module for node
  • WS websocket module for node
  • PHP (so far. You can adapt it to a number of mature scripting language that can be run as CGI)
  • Add a database of your choice.

Tested on Wheezy linux as used on the Raspberry PI, which is a Debian warranty. You can easily adapt it to other platforms.

##Installation##

2014.01.23: For Raspberry PI you have to install nodejs ver 0.10.2 manually

Install node JS on your system. On Derbian/Ubuntu:

$ sudo apt-get install npm php5-cgi php5-json

Make sure you get a fairly recent version for your distribution. At least ver 0.10.X Test with:

$nodejs -v

Create a project directory.

$ mkdir yourdir
$ cd yourdir

Node JS contains the nice node package manager npm. Use it to install 4 modules:

$ npm install express ws ini cron wildcard

Get the WAS application:

$ wget https://github.com/paragi/was/archive/master.zip
$ unzip master.zip
$ mv was-master/* ./
$ rm -r was-master
$ rm master.zip

Run the server:

$ nodejs server.js

Use a browser to access the server on port 8080 eg. 127.0.0.1:8080

Change settings in node-was.conf

To start and monitor the server, install and use the upstart package

##PHP##

PHP support is achieved using php-cgi and by transfering request data to a script called PHP-burner, that presents the appropriate superglobals to make it look much like its running in an Apache module.

##Status## This is Proof of concept.
I have written another module specifically for PHP integration in node. Please see: https://github.com/paragi/sphp

was's People

Contributors

paragi avatar

Watchers

James Cloos avatar Andrey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.