Coder Social home page Coder Social logo

rm3l / java-websocket-reverse-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from barrett-rob/java-websocket-reverse-proxy

0.0 2.0 0.0 11 KB

Java implementation of a websocket reverse proxy

License: MIT License

Java 73.80% Shell 15.35% JavaScript 10.85%

java-websocket-reverse-proxy's Introduction

java-websocket-reverse-proxy

Most of the java websocket examples I've found have been based on, or included a messaging protocol like STOMP. This example is the result of looking at how to proxy any message content, without worrying about the messaging protocol.

Java implementation of a websocket reverse proxy. A similar method to the one described in https://www.nginx.com/blog/websocket-nginx/, but implemented in Java. This could be useful in Java application servers, e.g. Spring Boot.

There are nodejs scripts at the root level that can be used to mimic functionality required to verify the proxy server.

The common one is the websocketserver.js script, which listens on port 9999 and echoes back any input after uppercasing it. To test the echoing behaviour by establishing a direct connection to a websocket server, run test_websocketserver_direct.sh

(requires node & npm to be installed)

There is also a very simple websocketproxy.js script which will proxy the websocketserver. It listens on port 8888 and will relay all requests to port 9999. It can be tested by running test_websocketserver_nodeproxy.sh

A simple java implementation to match this proxying behaviour is contained in the classes defined in the src folder. It is based on Spring Boot. You can build it using Gradle and run it up manually, or use the test_websocketserver_javaproxy.sh script.

The java websocket reverse proxy will listen on port 7777 and relay all requests to port 9999.

(developed on macOS, ymmv on other platforms)

java-websocket-reverse-proxy's People

Contributors

barrett-rob avatar borgle 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.