Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovery service: getting an error because of the protocol mismatch #4

Open
azangru opened this issue Aug 17, 2016 · 7 comments
Open

Comments

@azangru
Copy link

azangru commented Aug 17, 2016

The discovery service at multiscreen.samsung.com is working now. Which is great!

But I am having a different problem now. I am trying to run SmartView HelloWorld application in the browser on my development machine, and here is what is happening, step by step:

At this point, a request from the discovery service iframe (at https://multiscreen.samsung.com/discoveryservice/v2/discover) is being sent to my TV’s local server (at http://10.18.0.123:8001/api/v2/), which is obviously blocked, because XHR requests can’t be sent from https to http. As a result of this error, the HelloWorld application fails to find the TV.

Is there a solution for this problem? Could you please help? @monster-mj ?

@monster-mj
Copy link
Contributor

monster-mj commented Aug 19, 2016

Hi, azangru
To help your troubleshoot, I need more infomation.

  1. what type is your devleopement machine?
    http server or https server?
    if http server it works well, but https block mixed content from TV http server.
    so, I recommand you use http server.
  2. refer to our helloworld sample app
    sender : http://www.samsungdforum.com/smartview/helloworld/mobile
    receiver : http://www.samsungdforum.com/smartview/helloworld/tv
    To launch receiver app you should set to allow receiver's url.
    read a article of How to get Smart View cloud launched app running on the TV? part in "https://www.samsungdforum.com/TizenGuide/tizen4591/index.html"
    maybe your app is blocked with receiver unkown url

thanks.

@azangru
Copy link
Author

azangru commented Aug 19, 2016

Hey @monster-mj,

Regarding this part of your question:

http server or https server?

Are you asking, whether I am trying to connect to Samsung’s discovery service server over http or https protocol?

The previous version of the msf library used the discovery service over http at http://multiscreen.samsung.com/discoveryservice/v2/discover . But the discovery service at this url has not been working since last autumn. The new version of the msf library (msf-lib-2.3.1) uses the discovery service over https at https://multiscreen.samsung.com/discoveryservice/v2/discover. The discovery service at this url does respond, but since it is working over https, it blocks mixed content from TV http server. So Samsung’s http server does not respond at all, and the https server does not work because of mixed content. There is no way I can change this.

As for this part of your question:

what type is your devleopement machine?

Could you please let me know what information about my development machine you are interested in?

@monster-mj
Copy link
Contributor

Sorry, I'm late.
let's look one by one

first of all, I ask one thing.
Is TV device name displayed browser when you open the index.html ???
if yes, are asking do nothing when click a TV name?

@azangru
Copy link
Author

azangru commented Aug 25, 2016

@monster-mj

The TV device name is not displayed in the browser when I open index.html

image

When I tried to reproduce the error today, I could not even get the TV to be detected by Samsung’s discovery service. Here are the relevant parts of the code

  1. Contents of index.html:

image

  1. Part of the javascript code inside the iframe:

image

The result of the request to the discovery service is an empty array, which means that my TV has not been detected by the discovery service. This is something new: previously, my TV was detected by the discovery service, and at this point in the code its IP was showing correctly. Previously, the problem was occurring in this place in the code (also from inside the iframe), when a new request was sent from the discovery service to my TV (and there was a mixed content error), but I can't reproduce it today:

image

@azangru
Copy link
Author

azangru commented Aug 26, 2016

Ok, this time the discovery service could detect my TV, so I can update my information with the original problem I was experiencing.

So here goes:

  1. TV is not detected in the browser:

image

  1. The browser page has an iframe referring to the device discovery service:

image

  1. The discovery service document inside the iframe calls another Samsung service to detect my TV. The TV’s IP and the url of its local server are detected correctly (demonstrated on the screenshot below in the console log):

image

  1. The script on the discovery service page attempts to check my TV device by sending an XHR request to it:

image

  1. The request fails, because the discovery service page is running on https, and TV’s local server is on http. Hence the mixed content error:

image

Because of this, the browser/mobile version of the HelloWorld app running in the browser cannot detect the TV version of the app running on the TV.

@monster-mj
Copy link
Contributor

I'm sorry that I only have tested my Mac with Safari, it's working well.
but I realized that other browser(Chrome,Firefox..) disable to request mixed content.
now, I got this issue.
Thanks your infomation

@zhixueyong
Copy link

I am getting this error when running SmartViewSDKHelloWorld/HelloWorld_js_mobile_tv:
Failed to load resource: the server responded with a status of 503 (Service Unavailable: Back-end server is at capacity)
Is the server down?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants