Socket
Book a DemoInstallSign in
Socket

@gun-vue/relay

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gun-vue/relay

A simple GUN peer relay for self- hosting

0.6.1
latest
Source
npmnpm
Version published
Weekly downloads
7
-58.82%
Maintainers
0
Weekly downloads
 
Created
Source

Gun-Vue: Relay

@gun-vue relay logo

GitHub (/relay)npmDocs

A simple Gun relay peer in Node.js.

This package is part of Gun-Vue: The Peer-to-Peer Web App Toolkit

How to Install

Requirements

  • Node.js >=16.x
  • npm

Instructions

  • Create a new Node.js project:
npm init -y
  • Install the Gun-Vue: Relay package as a dependency:
npm i @gun-vue/relay
  • Open package.json and add:
"scripts": {
    "start": "node start.js"
  }
  • Create a start.js script and add:
import relay from "@gun-vue/relay";

relay.init();
  • Test the relay:
node start.js
Hello wonderful person! :) Thanks for using GUN, please ask for help on http://chat.gun.eco if anything takes you longer than 5min to figure out!
AXE relay enabled!
Server started at http://localhost:8765/gun
Multicast on 233.255.255.255:8765

Options

The relay can be customized with an options object by updating start.js:

relay.init({
	host: "localhost", // Domain or IP address where your relay is hosted (no 'http://')
	port: 8765, // The port your relay will listen on (e.g., 8080)
	store: false, // Use 'true' to enable persistent storage on disk
	path: "public", // Folder to serve static files (e.g., your front-end build)
	showQr: "false", // Render a QR Code Link to the server
});

Alternatively, create a .env file and add the following defaults:

RELAY_HOST="localhost"
RELAY_STORE=false
RELAY_PORT=8765
RELAY_PATH="public"
RELAY_QR=false

Standalone Executable

You can build a standalone executable that bundles Node.js runtime with the relay server. This creates a larger file (≈90MB) but allows for easy distribution and running without Node.js installation.

Building the Executable

  • Clone the repository and install dependencies:
pnpm install
  • Browse the /relay/ folder and build the bundled application:
cd relay
pnpm build
  • Create the platform-specific executable:

For MacOS:

pnpm app:macos

For Windows:

pnpm app:windows

For Linux:

pnpm app:linux

The executable will be created in the dist folder as:

  • MacOS: gun-relay
  • Windows: gun-relay.exe
  • Linux: gun-relay-linux

Running the Executable

Simply double-click the executable or run it from the terminal:

./dist/gun-relay  # MacOS/Linux
.\dist\gun-relay.exe  # Windows

The relay will start with default settings. You can still use environment variables to configure it by creating a .env file in the same directory as the executable.

FAQs

Package last updated on 11 Mar 2025

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.