Socket
Book a DemoInstallSign in
Socket

io.github.nemesismate:spring-ws-tunnel-core

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io.github.nemesismate:spring-ws-tunnel-core

Spring WS Tunnel - Core Library

1.1.1
Source
mavenMaven
Version published
Maintainers
1
Source
Readme not found for selected version
Showing the latest (latest)

spring-ws-tunnel

build main Maven Central

This project can turn any spring application into an API tunnel gateway, allowing a local server to act as one located in the same network the gateway is without requiring special routings (the client becomes the server and the server becomes the client).

This is achieved by using a webscoket connection as a tunnel to forward HTTP or other WS requests.

Any remote communication (HTTP or WS) following a client -> server model:

Can be tunneled to a local server:

Libraries

  • spring-ws-tunnel-core: main tunneling functionality. This library is required to setup your tunnel gateway.
  • spring-ws-tunnel-demo-server: minimal server setup example. It showcases the tunneling system, including a Web UI (tunnel client) served as an static application.

Tunnel Setup

Once included the library in the application (io.github.nemesismate:spring-ws-tunnel-core), enabling the tunnel functionality is done with the relevant annotations.

@EnableTunnelHttpApi
@EnableTunnelWsApi
@SpringBootApplication
public class TunnelApplication {

    public static void main(String[] args) {
        SpringApplication.run(TunnelApplication.class, args);
    }

}

The application will complain if the tunneling is enabled but a TunnelListener bean doesn't exist.

@Bean
public TunnelListener tunnelListener() {
    return TunnelListener.Default.builder()
            .onTunnelCreate(id -> {
                System.out.println("Created tunnel: " + id);
                return true;
            })
            .onTunnelDelete(id -> System.out.println("Deleted tunnel: " + id))
            .build();
}

Tunnel Setup - Spring Cloud Gateway (WIP)

A very simple and powerful approach to setup this Tunnel applicationis with Spring Cloud Gateway.

FAQs

Package last updated on 26 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.