GithubHelp home page GithubHelp logo

wsmc's Introduction

wsmc

WebSocket proxy to Minecraft servers

Allows you to write Minecraft clients connecting over WebSockets

Proxy Usage

node wsmc.js

Options default to:

--wshost=0.0.0.0    websocket host to listen on
--wsport=1234       websocket port to listen on
--mchost=localhost  minecraft host to connect to
--mcport=25565      minecraft port to connect to
--prefix=webuser-   prefix for usernames of websocket-connecting users

When the proxy receives a WS connection, it will connect to the MC server, perform the handshake, negotiate encryption, then pass raw binary packets between the WS client and MC server using websocket-stream.

Limitation: WSMC doesn't perform user authentication (how could it?). Users currently can connect with no password and they will be given a username beginning with 'webuser-' followed by a number.

Client Example

mcwebchat - a simple web-based chat client

The WS client is responsible for decoding the packets received and encoding packets sent. Protocol encryption is automatically handled by the proxy, but clients still need to unpack/pack the binary data transmitted over the wire for efficiency.

A nice benefit of using WebSockets is that the protocol is already message-based, so the client doesn't have to concern itself with packet lengths (each WS message contains exactly one MC packet).

Project Ideas

Now that your Minecraft server is accessible via WebSocket, what can you do with it? The mcwebchat example isn't very useful, so here are a few more ambitious project ideas possible with a WSMC backend, for anyone up for the challenge:

  • (Medium) A viewer-only graphical web-based Minecraft client. Allow the player to walk around, browse the server but not interact. Server owners could place this client on their website, as a quick preview for prospective players on their server, to easily check out without having to fire up the game itself. No authentication needed since the viewer would be anonymous and read-only, but could possibly benefit from packet filtering and/or server-side permissions to restrict unintentionally allowing clients to modify the server in any way.

  • (Hard) A fully-functional interactive 3D web-based Minecraft client, supporting most of the features of the game. Likely needs authentication to be useful, but the idea would be players could casually join through the web without having to keep up with Java updates etc. and using the official Minecraft client; the web-based client should be functional enough to allow a reasonable level of ordinary gameplay. Including interacting with the world and any feature you might expect.

  • (Extreme) A highly customizable flexible modular interactive 3D web-based Minecraft client, with support for adding new game content. Taking the above idea a step further, turning it into the ultimate gameplay experience. Instead of messing with installing modifications to Minecraft, you could use this hypothetical web-based client and it would deliver everything you need through the web server. No need for the player to concern themselves with updates since it all comes from the web and is controlled by the webmaster, and it would even be safer since like all webpages it runs in the browser sandbox. May or may not be feasible, but could be interesting. Compare to: Feed the Beast, Technic Platform, etc.

For a very incomplete WebGL/voxel.js-based client which doesn't implement any of these ideas or work very well at the moment, but could be a good place to start or for reference purposes, see voxel-clientmc (any help welcome).

License

MIT

wsmc's People

Contributors

deathcap avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.