Not able to connect to Internet via proxy in Tizen emulator

雨燕双飞 提交于 2019-11-28 11:55:54

问题


When i use ajax code to retrieve a json data, in tizen wearable emulator 2.3.1, I'm getting not able to connect to proxy error.

But when I searched, everyone is telling no need to give any specific proxy settings for emulator. If internet works fine in Tizen ide, then it will work in Tizen emulator too. But I'm getting proxy error.

Can someone help me solve this proxy error?

Update:

Where should I change the proxy?

Code sample:

 $.getJSON( "http://api.geonames.org/citiesJSON? north=44.1&south=-9.9&east=-22.4&west=55.2&lang=de&username=demo", function( data ) {
                  $('#divText').html(data.result);
                })
                .fail(function( err ) {
                    //Never called
                    console.log( err );
                });
        }

回答1:


Add internet access privilege for your Tizen application in the config.xml file.Internet Privilege allows the application to access the Internet.

    <tizen:privilege name="tizen.org/privilege/internet"/>

Also defining external access Policy may be required to access network. According to the W3C Access Requests Policy (WARP), you cannot access external network resources by default. If you require access to an external network resource, you must request network resource permissions for the Web application using the Policy in the config.xml file.

    <access origin="*" subdomains="true"/>

Now your application should be able to access internet from the emulator as well as real devices.




回答2:


In the emulator's configuration set the proy as use host proxy and the connect type as NAT then to access your local server use 10.0.2.2 as IP address



来源:https://stackoverflow.com/questions/37783743/not-able-to-connect-to-internet-via-proxy-in-tizen-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!