platform/shared/common/RhodesApp.cpp in rhodes-7.5.1 vs platform/shared/common/RhodesApp.cpp in rhodes-7.6.0
- old
+ new
@@ -201,14 +201,18 @@
String strUrl = RHODESAPP().getBaseUrl();
strUrl += strCallback;
boolean force_https = false;
+ boolean force_custom_protocol = false;
#ifdef OS_MACOSX
if (rho_conf_is_property_exists("ios_https_local_server")!=0) {
force_https = rho_conf_getBool("ios_https_local_server")!=0;
}
+ if (rho_conf_is_property_exists("ios_direct_local_requests_with_custom_protocol")!=0) {
+ force_custom_protocol = rho_conf_getBool("ios_direct_local_requests_with_custom_protocol")!=0;
+ }
#endif
NetResponse resp = getNetRequest().pullData( strUrl, NULL );
if ( !resp.isOK() )
{
@@ -220,17 +224,23 @@
bTryAgain = true;
}
#else
String addr_number;
String addr_local;
- if (force_https) {
- addr_number = "https";
- addr_local = "https";
+ if (force_custom_protocol) {
+ addr_number = "rhoctp";
+ addr_local = "rhoctp";
}
else {
- addr_number = "http";
- addr_local = "http";
+ if (force_https) {
+ addr_number = "https";
+ addr_local = "https";
+ }
+ else {
+ addr_number = "http";
+ addr_local = "http";
+ }
}
addr_number = addr_number + "://127.0.0.1:";
addr_local = addr_local + "://localhost:";
if ( String_startsWith( strUrl, addr_number ) )
{
@@ -573,10 +583,14 @@
net::CDirectHttpRequestQueue directQueue(*m_httpServer, *this );
if (RHOCONF().isExist("ios_direct_local_requests")) {
shouldRunDirectQueue = RHOCONF().getBool("ios_direct_local_requests");
}
+ if (RHOCONF().isExist("ios_direct_local_requests_with_custom_protocol")) {
+ shouldRunDirectQueue = shouldRunDirectQueue || RHOCONF().getBool("ios_direct_local_requests_with_custom_protocol");
+
+ }
if (RHOCONF().isExist("ios_use_old_legacy_socket")) {
shouldUseCocoaServer = !RHOCONF().getBool("ios_use_old_legacy_socket");
}
#ifdef RHODES_EMULATOR
shouldRunDirectQueue = false;
@@ -1830,26 +1844,36 @@
if (isWebkitOutofProcess())
m_isJSFSApp = false; //We need local server for out of process webkit, it use sockets to call common API
#endif
boolean force_https = false;
+ boolean force_custom_protocol = false;
#ifdef OS_MACOSX
if (rho_conf_is_property_exists("ios_https_local_server")!=0) {
force_https = rho_conf_getBool("ios_https_local_server")!=0;
}
+ if (rho_conf_is_property_exists("ios_direct_local_requests_with_custom_protocol")!=0) {
+ force_custom_protocol = rho_conf_getBool("ios_direct_local_requests_with_custom_protocol")!=0;
+ }
#endif
#ifdef OS_ANDROID
const char* value = get_app_build_config_item("local_https_server_with_client_checking");
force_https = value && strcmp(value, "1") == 0;
#endif
- if (force_https) {
- m_strHomeUrl = "https://127.0.0.1:";
+ if (force_custom_protocol) {
+ m_strHomeUrl = "rhoctp://127.0.0.1:";
}
else {
- m_strHomeUrl = "http";
- m_strHomeUrl = m_strHomeUrl + "://127.0.0.1:";
+
+ if (force_https) {
+ m_strHomeUrl = "https://127.0.0.1:";
+ }
+ else {
+ m_strHomeUrl = "http";
+ m_strHomeUrl = m_strHomeUrl + "://127.0.0.1:";
+ }
}
m_strRubyServerHomeURL = m_strHomeUrl+getFreeListeningPort();
m_strNodeServerHomeURL = m_strHomeUrl+getNodeJSListeningPort();