RHazDev / Socket4MC

Sockets for Minecraft servers



You don’t like Plugin Messaging Channels? You want to use sockets but you think it’s too difficult for you? This API allows developers to send data from Bungee to Spigot/Sponge and from Spigot/Sponge to Bungee.

♦ Use Sockets (in case you haven’t understood yet)

♦ Very easy-to-use

♦ Call Bungee and Spigot/Sponge events

♦ Lightweight, fast, efficient

♦ Encrypted data transfer (RSA encryption)

You have to install and configure Socket4MC on BungeeCord and on all your Spigot/Sponge servers

BungeeCord configuration:

port: 25575
name: "MyBungee"
security-level: 1
password: "My Secret Password"

Spigot/Sponge configuration:

host: "localhost"
port: 25575
name: "MySponge" // or "Factions", "Lobby", ...
password: "My Secret Password"

♦ host: BungeeCord’s address (e.g. mc.rhaz.fr, localhost) Set it to localhost if you don’t know what is it

♦ port: A port used for communication (not the same as your BungeeCord port)

♦ name: The server name (e.g. Factions, SmashBros) in lower case


0=no security,

1=AES encryption,

2=AES encryption and RSA keys sent

password: A password used to prevent third party connections

----------------- on Sponge -------------------

// Send a message "Ping!" to BungeeCord over channel "MyChannel"
public void sendPing()
	JSONMap map = new JSONMap(
		"message", "Ping!"

	Socket4Sponge.getClient().write("MyChannel", map);

// Send it when it is connected
public void onHandshake(ClientSocketHandshakeEvent e){

------------------- on BungeeCord -------------------

public void onEnable() {
   getProxy().getPluginManager().registerListener(this, this);

// Receive a message "Ping!" from Spigot and send "Pong!"
public void onSocketMessage(ServerSocketJSONEvent e){

	String channel = e.getChannel(); // The channel name
	if(!channel.equals("MyChannel")) return;

	String name = e.getName(); // The name of the server

	String message = e.getExtraString("message");
	getLogger().info("Received message from " + name + ": " + message);

		e.write("message", "Pong!"); // Quick reply to this channel



Category: Developer Tools

Published on May 6, 2018


2 stars

15 total downloads