Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2017-08-28 00:44:03

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

use HTTPS with playerio in js

I noticed that Jesse in their unfavoriter code thing, they had 'PlayerIO.useSecureApiRequests = true;'

I would like to implement the same functionality in a JS bot of mine, but I get:

Authenticated
Loaded config
Determining joinRoom or createJoinRoom
Error: GeneralError: Could not establish a socket connection to any of the given endpoints for the room

In the JS debugger, each one has something along the lines of this:

Unable to connect to endpoint: gs47.playerio.com:27000. reason: "SecurityError: The operation is insecure.". No more endpoints to try.

What do I do?

Offline

#2 2017-08-28 01:06:33

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: use HTTPS with playerio in js

IIRC there is also a second line you need to add in the connect callback, similar to the one you've already added.
Not sure if this is what would be causing the errors though

Offline

Wooted by:

#3 2017-08-28 01:13:25

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: use HTTPS with playerio in js

destroyer123 wrote:

IIRC there is also a second line you need to add in the connect callback, similar to the one you've already added.
Not sure if this is what would be causing the errors though

You appear to be right,

client.multiplayer.useSecureConnections = true;

This is what I've needed.

For future reference:

*PlayerIO.useSecureApiRequests = true;
global = {
	client: null,
	connection: null,
	players: {}
}

function Start() {
	var email = prompt("Email: ");
	var password = prompt("Password: ");
	var worldID = prompt("World ID: ");
	
	PlayerIO.authenticate("everybody-edits-su9rn58o40itdbnw69plyw", "simpleUsers", { email: email, password: password }, {}, function(client) {
*		client.multiplayer.useSecureConnections = true;
		global.client = client;
		Log("Authenticated");
...

Line 1 and 14 ( I used * to mark them )

Offline

Wooted by:
SirJosh39171503879205675182

Board footer

Powered by FluxBB

[ Started around 1711626945.2186 - Generated in 0.026 seconds, 11 queries executed - Memory usage: 1.39 MiB (Peak: 1.49 MiB) ]