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 MidgardDev · Mar 04, 2016 at 05:55 PM · webglwwwformwww class

WWW class on WebGL: URL is wrong

Hi there, I've googled a lot but I'm unable to find any info in this subject, since I don't really know what to search, because this problem is a little curious.

So, basically I'm using the WWW Class for Authenticating on my new game, everything works right inside the Editor, but once you compile to WebGL and upload the build you can clearly see something's wrong.

This is the code I'm using to check if the Auth Service is reachable:

 WWW www = new WWW("http://devmidgard.com/auth");
 
         while (!www.isDone)
         {
             yield return null;
         }
 
         if (www.error == null)
         {
             Debug.Log("Ping Done, Auth Service reachable.");
             isConnected = true;
         }
         else
         {
             // Some error here
         }

Everything should be right, it works in Editor and it should be fine.

But I was surprised when I checked Chrome's Console for errors, since the try to ping the Auth Service failed, and this is what I got:

 GET http://devmidgard.com/games/hockey/devmidgard.com/auth 404 (Not Found)

http://devmidgard.com/games/hockey/ is the place where you can play the game.

While the later part (devmidgard.com/auth) is where the Auth Service is located (all the php scripts that make contact with a database, and return values, etc).

The problem is, as you can see, the WWW Class joined the working directory (http://devmidgard.com/games/hockey/) with the Request URL (http://devmidgard.com/auth).

Is there something I might be doing wrong? I don't really know how to solve this issue, but it is critical. If I'm unable to contact my Auth Server, then I'm unable to load the player's progress, etc.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by illa3d · Aug 18, 2016 at 03:23 PM

I'm getting the same issue on both Chrome and Firefox with the newest Unity 5.4.0. I noticed that error while still on 5.3.3.

In my eyes this is a bug and is reported.

For the time being the only solution is to have the index.html in the root, or every WWW asset or service you need in the subfolder to the root index is in. That way you can just add incrementally paths to the "home app path". In your case that would be devmidgard.com/games/hockey/auth.

Comment
Add comment · Show 1 · Share
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 MidgardDev · Aug 18, 2016 at 03:25 PM 0
Share

Hey, I ended up upgrading to the latest version of Unity back then and it worked. I really don't know what was wrong.

I haven't checked with Unity 5.4.0 but I will try it out later, it might have appeared again.

Thanks for your time

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

40 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

Related Questions

How to use POST service using www class? 0 Answers

Use the data received from WWW in UI 1 Answer

WWW Class is acting up 1 Answer

How to read and rewrite text files on a local host with WebGL? 0 Answers

File Paths to load files with WWW for WebGL 0 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