Go implementation of a WAMP (Web Application Messaging Protocol) client and router
Go
Latest commit 1c08e32 Dec 5, 2016 @mourad mourad committed on GitHub Merge pull request #134 from zerodivisi0n/fix-empty-options
Fix empty options
Permalink
Failed to load latest commit information.
examples Clean version Nov 7, 2016
turnpike Add debug flag to turnpike command Sep 19, 2015
vendor Turn on vendoring Oct 25, 2016
.gitignore Implemented 13.3.5. Caller Identification Nov 6, 2016
CONTRIBUTING.md Add CONTRIBUTING.md Sep 2, 2015
CONTRIBUTORS Implemented 13.3.5. Caller Identification Nov 6, 2016
LICENSE Add license (MIT) Sep 2, 2013
README.md Fix GoDoc link in README Oct 20, 2015
authentication.go Add basic documentation Jan 16, 2015
authorizer.go Functions that took Peer now take *Session (also added Oct 27, 2016
broker.go Fix 'go vet' warning Oct 28, 2016
broker_test.go Functions that took Peer now take *Session (also added Oct 27, 2016
client.go Fix empty options Dec 5, 2016
client_test.go Added options to Call method in Client May 10, 2016
dealer.go Clean version Nov 7, 2016
dealer_test.go Functions that took Peer now take *Session (also added Oct 27, 2016
dial.go Expose DialFunc when creating a Websocket peer Oct 25, 2016
doc.go Work on documentation Sep 7, 2015
interceptor.go Functions that took Peer now take *Session (also added Oct 27, 2016
log.go Add DebugOff function to switch to noop logger Oct 12, 2015
log_test.go Clean up interfaces, rename client ==> peer Aug 11, 2014
message.go Remove HEARTBEAT message (removed from spec) Oct 28, 2016
peer.go Implemented many suggestions from golint Sep 6, 2015
realm.go Call localClient.Receive() Oct 28, 2016
realm_test.go Refactor router and realm Sep 4, 2015
router.go Pass session into callback functions Oct 28, 2016
router_test.go Implemented many suggestions from golint Sep 6, 2015
serialize.go Implemented many suggestions from golint Sep 6, 2015
serialize_test.go Add CONTRIBUTING.md Sep 2, 2015
session.go Revert "Remove session's registrations when leaving realm" Oct 12, 2015
util.go Implemented many suggestions from golint Sep 6, 2015
websocket.go Remove 'origin' (unused) Oct 28, 2016
websocket_server.go NewClient already calls run(), do not call it again in the GetLocalCl… May 11, 2016
websocket_test.go Remove 'origin' (unused) Oct 28, 2016

README.md

Turnpike Build Status Coverage Status GoDoc

Go implementation of WAMP - The Web Application Messaging Protocol

WAMP ("The Web Application Messaging Protocol") is a communication protocol that enables distributed application architectures, with application functionality spread across nodes and all application communication decoupled by messages routed via dedicated WAMP routers.

At its core, WAMP provides applications with two asynchronous messaging patterns within one unified protocol:

  • Publish & Subscribe
  • Remote Procedure Calls

This package provides router and client library implementations as well as a basic stand-alone router. The router library can be used to embed a WAMP router in another application, or to build a custom router implementation. The client library can be used to communicate with any WAMP router.

This version of Turnpike supports WAMP v2. For WAMP v1 support see the v1 branch.

Status

Turnpike v2 is still under development, but is getting close to a stable release. If you have any feedback or suggestions, please open an issue.

Installation

Library:

go get -u gopkg.in/jcelliott/turnpike.v2

Stand-alone router:

go get -u gopkg.in/jcelliott/turnpike.v2/turnpike

Client library usage

// TODO

Server library usage

main.go:

package main

import (
    "log"
    "net/http"

    "gopkg.in/jcelliott/turnpike.v2"
)

func main() {
    turnpike.Debug()
    s := turnpike.NewBasicWebsocketServer("example.realm")
    server := &http.Server{
        Handler: s,
        Addr:    ":8000",
    }
    log.Println("turnpike server starting on port 8000")
    log.Fatal(server.ListenAndServe())
}

This creates a simple WAMP router listening for websocket connections on port 8000 with a single realm configured.

You can build it like this:

go build -o router main.go

Which will create an executable in your working directory that can be run like this:

./router

Stand-alone router usage

Run the router with default settings:

$GOPATH/bin/turnpike

Router options:

Usage of turnpike:
  -port int
        port to run on (default 8000)
  -realm string
        realm name (default "realm1")