-
Notifications
You must be signed in to change notification settings - Fork 0
Browser JS Edition
Trollhunters501PC edited this page Mar 19, 2025
·
14 revisions
In your Html add this:
<script src="https://cdn.jsdelivr.net/gh/Creadores-Program/ServerWebGamePost@1.2.1/browser/org/CreadoresProgram/ServerWebGamePost/client/ServerWebGamePostClient.js"></script>
Note
If your server does not support HTTPS, I recommend using an HTTPS proxy. SecureProxyLink is a great option that you can host for free on platforms like Vercel
Not supported!
You need to create a callback function. Something like that:
function processDatapacks(datapack){
//datapack = json
}
Simply in the ServerWebGamePostClient class Execute the sendDatapacket function
Something like that:
//client = ServerWebGamePostClient
client.sendDataPacket(packet);
//packet = json
// Remember to also send the identifier key
You must create a new ServerWebGamePostClient instance
var client = new ServerWebGamePostClient(domain, port, isHttps);
// domain = String (server domain or IP)
// port = Number (Server port)
// isHttps= boolean (whether the server has HTTPS encryption or not)
client.processDatapacks = callback;
//callback = function(Callback in charge of handling data packets )