🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

voxels-scripting-server

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

voxels-scripting-server

A basic server to run Voxels.com scripts

0.9.11
latest
npm
Version published
Weekly downloads
48
1500%
Maintainers
1
Weekly downloads
 
Created
Source

Self-hosted Voxels.com Scripting Server.

A package to allow people to create their own persistent scripting server. This module exports two objects:

  • Method makeVSS(); This function returns a promise containing the WebSocketServer when it has successfully started.
  • Object expressApp which is the express app object. See the express npm module documentation.

How to run your own server

  • Run npm i

  • Import makeVSS and enter a few lines of code: Using import

import {makeVSS} from 'voxels-scripting-server'

makeVSS(670).then((wss) => {
  if (wss) {
    console.log("Websocket started");
  } else {
    console.error("Websocket did not start");
  }
});

Using require:

const vss =require("voxels-scripting-server");

vss.default.makeVSS(670).then((wss) => {
  if (wss) {
    console.log("Websocket started");
  } else {
    console.error("Websocket did not start");
  }
});

There is a demo on repl.it: https://replit.com/@Benjythebee/testCryptovoxelsserver#index.js

  • In the examples above, replace 670 with the parcel id or space id you want to create a server for.

  • Once your server setup, go to your parcel page on Voxels.com and set Hosted script to true;

  • Then set the host address to wss://[The Address of server]/, Hit save.

Development

  • Clone the repo

  • npm run test:server will run a quick test server in client/server using the source code.

  • npm run test:client will run a quick test client in client/client_test.ts.

Contributing

todo:

  • Introduce ability to interconnect parcels.
  • Better tests

Any ideas are welcomed

FAQs

Package last updated on 15 May 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