Comments (5)
Hey, the multiplayer feature is currently an experimental implementation and works over a websocket proxy that only allows my local demo server for testing purposes.
You should be still able to join this demo server, doesn't matter which ip address you enter. Maybe open the devtools network tab and check for any error messages when connecting to the the websocket server.
I'm not at home right now and I tested it on my phone and it works just fine!
from js-minecraft.
Hi @LabyStudio
Thank you so much!
Here is the error log
Zoom in
from js-minecraft.
the code that forwards the websocket looks like this (run with: "npm init -y","npm i ws net" and "node proxy.js")
proxy.js:
//Simple local Websocket server for forwarding to //minecraft server import { WebSocketServer } from 'ws'; import * as net from "net"; const wss = new WebSocketServer({ port: 30023 }); wss.on('connection', function connection(ws) { ws.on('message', function message(data) { let a; try { if(ws.client) { ws.client.write(data); return; } a = JSON.parse(data); if(a?.payload?.host && a?.payload?.port ){ ws.client=new net.Socket(); ws.client.connect(a?.payload?.port, a?.payload?.host, function() { }); ws.client.on('data', function(data) { ws.send(data); }); ws.client.on('close', function() { ws.client.destroy(); // kill client after server's response }); } } catch (e) { return console.error(e); // error in the above string (in this case, yes)! } }); });
@kiliansinger
How did you get this to work? the client sends json which its not meant to.
@LabyStudio could you please help? i really want to improve this repo a lot I've already improved speeds. Would i be able to get a working Minecraft proxy
from js-minecraft.
the code that forwards the websocket looks like this (run with: "npm init -y","npm i ws net" and "node proxy.js")
proxy.js://Simple local Websocket server for forwarding to //minecraft server import { WebSocketServer } from 'ws'; import * as net from "net"; const wss = new WebSocketServer({ port: 30023 }); wss.on('connection', function connection(ws) { ws.on('message', function message(data) { let a; try { if(ws.client) { ws.client.write(data); return; } a = JSON.parse(data); if(a?.payload?.host && a?.payload?.port ){ ws.client=new net.Socket(); ws.client.connect(a?.payload?.port, a?.payload?.host, function() { }); ws.client.on('data', function(data) { ws.send(data); }); ws.client.on('close', function() { ws.client.destroy(); // kill client after server's response }); } } catch (e) { return console.error(e); // error in the above string (in this case, yes)! } }); });@kiliansinger How did you get this to work? the client sends json which its not meant to.
@LabyStudio could you please help? i really want to improve this repo a lot I've already improved speeds. Would i be able to get a working Minecraft proxy
I just published my proxy
https://github.com/LabyStudio/mc-websocket-proxy
from js-minecraft.
Thanks so much for the websocket proxy!
I have done a lot of improvements so I'll probably push then soon but i just have to replace all the textures
Here my change list:
- Fix confirm to exit when in world code
- Add world selection menu
- Fix chat scroll back which is infinite
- Should add own main menu panorama
- Improve loading splash screen
- Make join server loading text message actually update states
- Add change username and skin in settings
- Add Alex skin
- Fix kick msg, tabbar colors codes
- Fix chat colours
- Add full credits in settings
- Add button to right click so its easier on touchpad
from js-minecraft.
Related Issues (5)
- Multiplayer HOT 12
- Super laggy HOT 3
- License is missing HOT 2
- Refactoring this app HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-minecraft.