Documentation.

Server Libraries Node.js (Guests)

Sections

Basics

  1. Quick Start Guide
  2. Quick Start with Node.js
  3. Theming

Development

  1. Server Libraries
  2. Database Backends

Code API

  1. Server-side PHP
  2. Node.js Server
  3. Client-Side Scripts
 

Overview

The Node.js (Guests) library allows you to run Ajax IM using the included stand­alone mes­sage server. This allows you to sup­port a sig­nif­i­cantly larger num­ber of users simul­ta­ne­ously with­out as sig­nif­i­cant of a server strain. The script requires no data­base library, as it does not authen­ti­cate users; instead, it cre­ates tem­po­rary users on the fly as “Guests.”

This library makes use of the Mem­cache PHP exten­sion, as the Node.js server uses the Mem­cache API to com­mu­ni­cate with exter­nal scripts and appli­ca­tions. If you do not have the Mem­cache library installed in your PHP instal­la­tion, you will need install it before using this library.

Friends?

The Guests library makes all of the guest users friends of one-another as they con­nect. Each guest can see all other con­nected guests; how­ever, they can­not add or remove friends from their buddylist.

login() Function

The login() func­tion cre­ates new guest users and iden­ti­fies them to the Node.js server. It pro­vides a good exam­ple of using some of the Node.js Memcache-based APIs.

If you would like to change the pre­fix of the guest user­names to some­thing other than “Guest,” change the text between the sin­gle quotes on the first line of this func­tion ('Guest' to 'WhateverYouWant'). It is best to stick with alphanu­mer­ics sans spaces.

No Comments Yet

You can be the first to comment!

Leave a comment