Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A simple to use, high-level api for creating private servers for Growtopia with NodeJS.

License

Notifications You must be signed in to change notification settings

Pogtopia/GrowSockets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

41 Commits

Repository files navigation

GrowSockets

A simple to use api for creating private servers for Growtopia with NodeJS.
GrowSockets is still WIP but the core is done, only thing left to be added would be the "abstractions".

Requirements

  • Node v12+
  • Windows Build Tools (g++ for Linux. Just install build-essential).

Installation

NPM

  • $ npm install Pogtopia/GrowSockets

Yarn

  • $ yarn add Pogtopia/GrowSockets

Example

const GrowSockets = require("growsockets");
const server = new GrowSockets.Server({
 http: {
 enabled: true,
 },
});
server.on("connect", (netID) => {
 console.log("Peer", netID, "connected.");
 const peer = GrowSockets.Peer.new(server, netID);
 const packet = GrowSockets.TextPacket.from(0x1);
 peer.send(packet);
});
server.on("data", async (netID, chunk) => {
 const peer = GrowSockets.Peer.new(server, netID);
 console.log(peer.data); // shows the peer data.
});
server.on("disconnect", (netID) => console.log("Peer", netID, "disconnected"));
server.listen();

Documentation

Coming soon.

About

A simple to use, high-level api for creating private servers for Growtopia with NodeJS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /