Giter Club home page Giter Club logo

turnpike's Introduction

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")

turnpike's People

Contributors

jcelliott avatar beatgammit avatar djoyner avatar mourad avatar jakobgreen avatar jzelinskie avatar maxekman avatar sharpner avatar elimisteve avatar

Watchers

James Cloos avatar  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.