Skip to content

RJRYT/samp-socket-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SA-MP Socket Plugin (SSL-Free)

GitHub topic Built without OpenSSL Windows Linux GitHub release (latest by date) GitHub license GitHub stars GitHub all releases

A fast and minimal socket plugin for SA-MP (San Andreas Multiplayer), designed to run without SSL and provide simple TCP/UDP communication capabilities for SA-MP scripts.


Features

  • Lightweight & minimal
  • SSL-free build (for security-paranoid or minimalist environments)
  • Easy to compile on Linux and Windows
  • Compatible with most modern AMX-based SA-MP scripts

Why I Built This Version

The original BlueG Socket plugin had a major drawback β€” it relied on OpenSSL (libcrypto, libeay32.dll, ssleay32.dll) which caused runtime issues on both Linux and Windows:

🐧 Linux Issue

Failed (libcrypto.so.0.9.8: cannot open shared object file: No such file or directory)

πŸͺŸ Windows Issue

This application failed to start because libeay32.dll and ssleay32.dll were not found.

These external dependencies were either missing, incompatible, or flagged by antivirus software. Most users had no idea how to get the right versions or where to place them.

βœ… The Solution

I rebuilt the plugin from source and completely removed OpenSSL, eliminating these issues:

  • 🚫 No more libcrypto dependency on Linux
  • 🚫 No more libeay32.dll / ssleay32.dll needed on Windows
  • βœ… Just drop the plugin and it works β€” no DLLs, no errors, no headaches

This makes the plugin lightweight, portable, and production-ready, especially for custom backend communication (e.g., Node.js, Python, etc.).

Built to make your SA-MP experience smoother. πŸ’‘


Installation

Prerequisites

  • SA-MP Server (0.3.7 or later)
  • Visual C++ Redistributable (if using Windows DLL)
  • socket.inc: Place it in your pawno/include folder

Windows (x86)

  1. Download the latest socket.dll from the Releases page.

  2. Copy socket.dll to your SA-MP server's plugins folder

  3. Copy socket.inc to pawno/include/

  4. Add socket to your server.cfg plugins line:

    plugins socket

Linux (x86/x64)

  1. Download socket.so from the Releases page.

  2. Copy socket.so to your plugins folder

  3. Copy socket.inc to pawno/include/

  4. Update server.cfg:

    plugins socket.so

Make sure the plugin file has execute permissions:

chmod +x plugins/socket.so

Build Guide

Linux

Requirements

  • g++
  • make

Steps

git clone https://github.com/RJRYT/samp-socket-plugin.git
cd samp-socket-plugin/socket
make

Output: Release/socket.so

Windows

-Requirements

Build Steps

git clone https://github.com/RJRYT/samp-socket-plugin.git
msbuild "absolute\path\to\socket.vcxproj" /p:Configuration=Release /p:Platform=Win32

Output: Release/socket.dll


Usage

#include <socket>

new Socket:g_socket;

public OnGameModeInit()
{
    g_socket = socket_create(TCP);
    socket_connect(g_socket, "127.0.0.1", 7000);
}

public onSocketAnswer(Socket:id, data[], data_len)
{
    printf("[TCP Server] %s", data);
}

License

This project is licensed under the MIT License. See LICENSE for more info.


Credits

  • Original by pBlueG
  • SSL-free rebuild and cross-platform packaging by RJRYT

Releases

Find prebuilt binaries for Windows and Linux under Releases

We recommend using GitHub Releases for cleaner version management without bloating the repo size.


Contributing

Feel free to fork and PR! For bugs, open a GitHub issue with detailed info. Contributions are always welcome.


Contact

About

πŸ”Œ SA-MP Socket Plugin – Clean Rebuild with Windows & Linux Support

Topics

Resources

License

Stars

Watchers

Forks