GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bmeck/session-web-sockets: (connect with socket.io) session passing

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
example
example
 
 
README.md
README.md
 
 
package.json
package.json
 
 
sws.js
sws.js
 
 

Repository files navigation

SessionWebSocket

Resources

Server Side

require("SessionWebSocket")

Client Side

The client side code is from within this repository

<script "./example/static/sws.js"></script>

Usage

  • On a server with

    • Connect.session
    • Socket.io
  • Get a session verifier

    var sws = require("SessionWebSocket")()

  • Setup the server

    var server = connect.createServer( ... connect.cookieDecoder(), connect.session(...), sws.http //not a function ... )

  • Setup socket.io

    //put our callback inside of sws.ws(...) io.listen(server,sws.ws(function(client){ //normal socket.io callback client.on("secure",function(){ console.log(client.session) //client.session is now available }) client.on("insecure",function(){ // fires when a message that is not the auth message arrives first }) }))

Usage Client Side

<script "./example/static/sws.js"></script>
<script>
  SessionWebSocket(function(socket){
    socket.send("woot!")//good to go
  })
</script>

Events

Socket.io.Client

  • secure - fires when auth sucedes, does not put the auth token in a "message" event
  • insecure - fires when auth fails, and then fires the "message" event

About

(connect with socket.io) session passing

Resources

Readme
Activity

Stars

32 stars

Watchers

2 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.