gammazero/nexus
关于
Full-feature WAMP v2 router and client written in Go
网站与应用开发可以做什么
- Concurrent Asynchronous I/O Nexus supports large numbers of clients concurrently sending and receiving messages, and never blocks on I/O, even if a client becomes unresponsive. See Router Concurrency and Client Concurrency for details.
- WAMP Advanced Profile Features This project implements most of the advanced profile features in WAMP v2. See current feature support provided by nexus. Nexus also offers extended functionality for retrieving session information and for message filtering, giving clients more ability to decide where to send messages.
- Flexibility Multiple transports and serialization options are supported, and more are being developed to maximize interoperability. Currently, nexus provides websocket, rawsocket (tcp and unix), and local (in-process) transports. JSON, MessagePack, and CBOR serialization is available over websockets and rawsockets.
- Security TLS is available over websockets and rawsockets with client and server APIs that allow configuration of TLS. The nexus router library also provides interfaces for integration of client authentication and authorization logic.
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
nexus: WAMP v2 Router and Client in Go
nexus is a WAMP v2 router library, client library, and a router service, that implements most of the features defined in the WAMP-protocol advanced profile. The nexus project is written in Go and designed for highly concurrent asynchronous I/O. The nexus router provides extended functionality. The router and client interoperate with other WAMP implementations.
Documentation
See the docs directory for documentation, examples, and operational details:
- Nexus Overview
- Understanding WAMP
- Getting Started with the nexusd router service
- Creating a WAMP router with nexus
- Creating an Example Subscriber Client
- Authenticators and Authorizers
- Cookie and Request Authentication and Authorization
- Router Concurrency and Client Concurrency
- Extended Functionality
- Relay Client
What is WAMP and nexus
The Web Application Messaging Protocol (WAMP) is an open standard WebSocket subprotocol that provides two application messaging patterns in one unified protocol: Remote Procedure Calls and Publish & Subscribe. WAMP is also referred to as WAMP-proto it distinguish it from other uses of the acronym.
Using WAMP you can build distributed systems out of application components which are loosely coupled and communicate in (soft) real-time. See Understanding WAMP for a more detailed description of WAMP.
Nexus is a software package that provides a WAMP router library, client library, and stand-alone WAMP router service. This nexus package provides a messaging system for building distributed applications and services. Endpoints using websockets, TCP sockets, Unix sockets, and in-process connections may all communicate with each other via pub/sub and routed RPC messaging.
- The router library can be used to build custom WAMP routers or to embed a WAMP router in an application.
- The client library can be used to build clients that connect to any WAMP server, or to communicate in-process with a WAMP router embedded in the same application.
- The router service can be run as-is to provide WAMP routing.
See nexus overview for more information.
Installation
Install nexusd router service from source
go install github.com/gammazero/nexus/v3/nexusd@latest
Run nexusd -help to see usage information.
Although nexusd can be run using only command line flags, a configuration file offers much more configurability.
Create configuration file and run nexusd service
wget https://raw.githubusercontent.com/gammazero/nexus/main/cmd/nexusd/etc/nexus.json
vi nexus.json
nexusd -c nexus.json
See Getting Started for more detail on configuring and running the router.
Install examples to run and test with
git clone [email protected]:gammazero/nexus.git
cd nexus/examples
Building routers and clients with nexus
The nexus router library is used to build a WAMP router or embed one in your service. The nexus client library is used to build WAMP clients into you goloang applications. To use either of these libraries, import the v3 version of the appropriate packages. Version v3 is the only currently supported version.
import (
"github.com/gammazero/nexus/v3/client"
"github.com/gammazero/nexus/v3/wamp"
)
Run nexusd from a container
Pull the nexusd container image built with the latest code version and run the container:
docker pull ghcr.io/gammazero/nexusd:latest
docker run ghcr.io/gammazero/nexusd:latest
Now it just works.
By default, the router accepts connections on port 8080 and allows anonymous communication with clients using realm1.
You can change the values or get help by passing options to the container process:
docker run ghcr.io/gammazero/nexusd:latest --ws 0.0.0.0:8888 --realm autobahn
docker run ghcr.io/gammazero/nexusd:latest --help
Alternatively, you can mount the nexusd configuration file to the container, and get a more customizable and secure environment. See the nexusd configuration reference for details. Finally, you can also run the container process as an unprivileged user.
Examples
Look at the examples to see how to create simple clients and servers. Follow the examples/README.md. Examples of using advanced profile features are also available in the documentation.
See examples
The examples include interoperability examples to demonstrate nexus working with different WAMP implementations. Each of these has its own README.md that describes how to set up the environment and run the examples.
See examples/interop
The nexusd service is also an example stand-alone WAMP router.
All the router options are configurable in nexusd using a configuration file, and one is provided in the cmd/nexusd/etc/ directory.
This can be used as starting point to write your own WAMP router service.
See nexusd
Contributing
Please read the Contributing guide if you are interested in becoming a contributor to this project.
Please report any problems, or request changes and new functionality by opening an issue.
Nexus Features
- Concurrent Asynchronous I/O Nexus supports large numbers of clients concurrently sending and receiving messages, and never blocks on I/O, even if a client becomes unresponsive. See Router Concurrency and Client Concurrency for details.
- WAMP Advanced Profile Features This project implements most of the advanced profile features in WAMP v2. See current feature support provided by nexus. Nexus also offers extended functionality for retrieving session information and for message filtering, giving clients more ability to decide where to send messages.
- Flexibility Multiple transports and serialization options are supported, and more are being developed to maximize interoperability. Currently, nexus provides websocket, rawsocket (tcp and unix), and local (in-process) transports. JSON, MessagePack, and CBOR serialization is available over websockets and rawsockets.
- Security TLS is available over websockets and rawsockets with client and server APIs that allow configuration of TLS. The nexus router library also provides interfaces for integration of client authentication and authorization logic.
Status
The currently maintained version of this module is 3.x. Earlier major versions are no longer supported.
Advanced Profile Feature Support
RPC Features
| Feature | Supported |
|---|---|
| progressive_call_results | Yes |
| progressive_call_invocations | Yes |
| call_timeout | Yes |
| call_canceling | Yes |
| caller_identification | Yes |
| call_trustlevels | No |
| registration_meta_events | Yes |
| registration_meta_procedures | Yes |
| pattern_based_registration | Yes |
| shared_registration | Yes |
| sharded_registration | No |
| registration_revocation | No |
| procedure_reflection | No |
| payload_passthru_mode | Yes |
PubSub Features
| Feature | Supported |
|---|---|
| subscriber_blackwhite_listing | Yes |
| publisher_exclusion | Yes |
| publisher_identification | Yes |
| publication_trustlevels | No |
| subscription_meta_events | Yes |
| subscription_meta_procedures | Yes |
| pattern_based_subscription | Yes |
| sharded_subscription | No |
| event_history | Yes |
| topic_reflection | No |
| testament_meta_api | Yes |
| payload_passthru_mode | Yes |
Other Advanced Features
| Feature | Supported |
|---|---|
| rawsocket (TCP & Unix) transport | Yes |
| session meta events | Yes |
| session meta procedures | Yes |
| TLS for websockets | Yes |
| TLS for rawsockets | Yes |
| challenge-response authentication | Yes |
| cryptosign authentication | Yes |
| cookie authentication | Yes |
| ticket authentication | Yes |
| batched WS transport | No |
| longpoll transport | No |
| websocket compression | Yes |
Extended Functionality
Nexus provides extended functionality around subscriber black/white listing and in the information available via the session meta API. This enhances the ability of clients to make decisions about message recipients.
探索相关项目
加载中…