Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by SteenPetersen · Aug 20, 2017 at 07:29 PM · webglserver-hostingbrowser communication

Webgl - Networked game - process of uploading - errors - questions

Hi I am making a multiplayer game with unity and have a couple of doubts.

First

the game consists of a bunch of clients, that connect to a single dedicated master Client (also a unity game on its own: hereafter referred to simply as 'server'). All of these clients speak to each other by relaying their information through this server using the LLAPI. I have made the game, which thus far is just a little man, some camera work and a chat system, work in webgl while speaking locally to my server.

I have now tested uploading it to Itch.io which works locally, as in speaking to '127.0.0.1'. However it does not work in firefox or edge. as it gets the following errors:

"exception thrown: SecurityError: The operation is insecure.,_JS_UNETWebSockets_SocketCreate@blob:https://v6p9d9t4.ssl.hwcdn.net/019f3d09-29d8-45d6-9b26-e85868c74456:2:234689" - unityLoader.js

its as soon as this code is run the error comes

 Debug.Log("connecting...");
         // does player have a name?
         string pName = GameObject.Find("NameInput").GetComponent<InputField>().text;
         if (pName == "")
         {
             Debug.Log("Enter a 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");



Secondly


I would like to ask how it is I would go about uploading the entire game to the internet. as Far as I can understand I could upload the server to a host and then guide the clients to that URL and that should work? So could I for example upload the server to AWS and then just have my clients connect to it from any browser? has anyone tried doing this? I love to hear what sort of solution people use for this.

e.g:

 connectionId = NetworkTransport.Connect(hostId, "URL_pointing_to_the_server", port, 0, out error);
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SteenPetersen · Aug 21, 2017 at 07:30 AM 0
Share

any feedback is appreciated.

avatar image SteenPetersen · Aug 21, 2017 at 02:53 PM 0
Share

Still getting the same exception thrown: SecurityError:

avatar image SteenPetersen SteenPetersen · Aug 21, 2017 at 07:28 PM 0
Share

$$anonymous$$ im getting to understand that this happen because I cannot create a secure websocket in a browser and for some reason chrome allows this between browser and local connection "127.0.0.1" where firefox doesnt even allow that.

Im wondering how to make a secure websocket connection:

there is some information in this thread but I have tried this:

https://forum.unity3d.com/threads/unet-wss-https.440463/

to no avail.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

71 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Easily getting variable values from WebGL in Browser 2 Answers

EntryPointNotFoundException when trying webgl browser communication jslib example 2 Answers

Texture is not loading using WWW class in WebGL build. 0 Answers

How to send multiple values from browser to unity webgl game? 1 Answer

Interact across browser javascipt and unity webgl 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges