websocket - Unity multiplayer game - Webgl in firefox | exception thrown: SecurityError: The operation is insecure -


i trying upload webgl based unity game, multiplayer game, playable in browser.

i have uploaded client itch.io , pointed to

connectionid = networktransport.connect(hostid, "127.0.0.1", port, 0, out error);

i run server on local machine in unity editor. chrome works fine , expected. in firefox , edge error:

exception thrown: securityerror: operation insecure.,_js_unetwebsockets_socketcreate@blob:https://v6p9d9t4.ssl.hwcdn.net/753f526f-e1d5-483f-9edb-bf327452c9bf:2:234689 

i suspect firefox not allow websockets? there way around this? , why work in chrome , else?

thank you

this function throws exception:

    public void connect() {     debug.log("connecting...");      string pname = gameobject.find("nameinput").getcomponent<inputfield>().text;     if (pname == "")     {         debug.log("enter name");         return;     }      playername = pname;      networktransport.init();     connectionconfig cc = new connectionconfig();      reliablechannel = cc.addchannel(qostype.reliable);     unreliablechannel = cc.addchannel(qostype.unreliable);      hosttopology topo = new hosttopology(cc, max_connection);      hostid = networktransport.addhost(topo, 0);      connectionid = networktransport.connect(hostid, "127.0.0.1", port, 0, out error);      connectiontime = time.time;      isconnected = true;      networkserver.usewebsockets = true;      debug.log("connected"); } 


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -