Coder Social home page Coder Social logo

ralscha / wamp2spring Goto Github PK

View Code? Open in Web Editor NEW
30.0 9.0 7.0 1.31 MB

WAMP 2 implementation for Spring 5

License: Apache License 2.0

Java 100.00%
wamp wamp-router wamp-protocol spring websocket subprotocol websockets wamp-specification java

wamp2spring's Introduction

Build Status

wamp2spring is a Java implementation of the WAMP specification built on top of the WebSocket support of Spring 5.
WAMP is a WebSocket subprotocol that provides two application messaging patterns: Remote Procedure Calls and Publish / Subscribe.

Implementation

wamp2spring implements the Basic Profile, but it does not support multiple realms in one application. Every connection, registration and subscription exists in the same realm and wamp2spring ignores the realm parameter of the HELLO message.

Additionally wamp2spring implements a few features from the Advanced Profile:

Feature Remark
caller_identification disclose_me option in the CALL message. Specification
subscriber_blackwhite_listing Exclude and include receivers with their WAMP session id. Only eligible and exclude options are implemented. Specification.
publisher_exclusion exclude_me option in the PUBLISH message. By default the publisher is excluded from receiving the EVENT message. Specification
publisher_identification disclose_me option in the PUBLISH message. Specification
pattern_based_subscription Prefix- and wildcard matching policies for subscriptions. Specification
event_retention Specification

Dataformats
wamp2spring supports JSON (wamp.2.json) and MessagePack (wamp.2.msgpack) required by the Basic Profile. In addition it supports CBOR (wamp.2.cbor) and SMILE (wamp.2.smile).

Fallback
Currently wamp2spring does not support a fallback solution when peers cannot establish WebSocket connections. autobahn-js implements a fallback with long polling. You find the description about the protocol in the specification (Section 14.5.3.3). So far I don't have a need for a fallback solution because WebSocket works fine especially when it's sent over TLS connections. But when there is a need I will try to add this fallback solution. Pull requests are always welcome.

Quickstart

See Wiki

Maven

See Wiki

Example applications

You find a collection of example applications in the wamp2spring-demo GitHub repository.

Changelog

See Wiki

More information

See Wiki

License

Code released under the Apache license.

wamp2spring's People

Contributors

ralscha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wamp2spring's Issues

Subscription options

Hi,

Is there any way to send along options with a subscription? I can only see a way of getting subscription to topics with no options.

Does wamp2spring-reactive support authentication?

Hi,
I now have a Wamp client that needs to authenticate authid and ticket. Can you tell me whether the current wamp2spring-reactive supports it and how to configure it? If not, can you tell me how to modify the wamp2spring-reactive source code to support it?
Thank you!

Cannot configure allowedOrigins for OriginHandshakeInterceptor

After an update to SpringBoot 2.1.4 and WAMP2Spring 2.0.2, my application stopped working. The OriginHandshakeInterceptor blocks requests since the Origin header contains the port 8080 which is not expected.

My setup is an Apache with

  RewriteEngine On
  RewriteCond %{HTTP:Upgrade} =websocket [NC]
  RewriteRule /ws           ws://localhost:8080/ws [P,L]
  RewriteCond %{HTTP:Upgrade} !=websocket [NC]
  RewriteRule /ws           http://localhost:8080/ws [P,L]

  ProxyPass /api/ http://localhost:8080/
  ProxyPassReverse /ws http://localhost:8080/ws

in front of the Spring Boot app.

I've tried to configure OriginHandshakeInterceptor#setAllowedOrigins() but got stuck at the point that it's created in AbstractWebSocketHandlerRegistration#getInterceptors() but I found no way to configure AbstractWebSocketHandlerRegistration#setAllowedOrigins()

Am I blind or how is this supposed to work?

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.