Skip to content

javascript sdk for quick build a chat room or other IM client

Notifications You must be signed in to change notification settings

fanux/lhttp-javascript-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

#client of lhttp - a powerful go websocket framework :dog: ###usage

lhttp_client = new Lhttp("ws://localhost:8081/chat");

lhttp_client.on_open = function(context){
}

lhttp_client.on_message = function(context){
    context.send("hello, there!");
}

lhttp_client.on_close = function(context){
}

###Context API overview

    //set lhttp command
    setCommand = function(str) {
    }

    getCommand = function() {
    }

    getHeader = function(str) {
    }

    addHeader = function(key, value) {
    }

    getBody = function() {
    }

    //send lhttp body
    send = function(body) {
    }

    //publish a message to a channel
    publish = function(channel, command, headers, body) {
    }

    //subscribe a channel
    subscribe = function(channel, command, headers, body) {
    }

###A chat room demo create a chat room within 40 lines code!!!

About

javascript sdk for quick build a chat room or other IM client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published