@minecraft-js/proxies
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Proxies

Create proxies for Minecraft

Documentation

Installation

Install the package:

$ npm install @minecraft-js/proxies

And then import it in your JavaScript/TypeScript file

const Proxies = require('@minecraft-js/proxies'); // CommonJS

import * as Proxies from '@minecraft-js/proxies'; // ES6

Read only proxies

Read only proxies are proxies where you can only read packets. Create a read only proxy like so

const proxy = new Proxies.ReadOnlyProxy({
  serverHostname: 'localhost', // Target server hostname
  port: 8080, // Proxy port
});

And then you can use the ReadOnlyProxy#on method to listen for different events:

  • raw_listening - When the TCP server is listening
  • raw_connect - When a client opens a connection
  • raw_disconnect - When a client closes a connection
  • raw_close - When the TCP server is closed
  • error - When an error occurs
  • outgoing_data - When data is sent to the target server
  • incoming_data - When data is received from the target server

Using TypeScript?

If you are using TypeScript or you want type checking make sure to install the typed-emitter package!

$ npm install typed-emitter

Readme

Keywords

Package Sidebar

Install

npm i @minecraft-js/proxies

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

7.51 kB

Total Files

7

Last publish

Collaborators

  • richarddorian