Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
188 views
in Technique[技术] by (71.8m points)

javascript - 将Apache Thrift与Apache Cordova结合(Combining Apache Thrift with Apache Cordova)

I was wondering if anybody had any success with making a app with Cordova and then send an RPC call using Thrift.

(我想知道是否有人通过Cordova制作应用程序然后使用Thrift发送RPC调用是否成功。)

I was trying to send a string to a C++ server from my phone on a different network but it wouldn't because of CORS.

(我试图从另一个网络上的电话向C ++服务器发送字符串,但这不是因为CORS。)

Anyway around this?

(反正这吗?)

  ask by Moeiz Riaz translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Cordova and Phonegap does NOT use or enforce CORS.

(Cordova和Phonegap不会使用或强制执行CORS。)

The security is handle a different way -- with white-list s.

(安全性以另一种方式处理-使用白名单 。)

Here is what you need to know.

(这是您需要知道的。)

From Top Mistakes by Developers new to Cordova/Phonegap you have hit:

(从Cordova / Phonegap的开发人员的最新失误中您可以找到:)

  • #10 Not adding the new "white-list" and "white-list plugin" parameters in config.xml.

    (#10 未在config.xml中添加新的“白名单”和“白名单插件”参数。)

For #10

(对于#10)

This relatively * NEW * requirement means – to access ANY website or resources on the web, you MUST use the whitelist and the whitelist plugin.

(这种相对*新*的要求意味着–要访问任何网站或Web资源,您必须使用白名单和白名单插件。)

This requirement goes into affect if you are using cordova-android@4.0.0 or better;

(如果您使用的是cordova-android@4.0.0或更高版本,则此要求生效。)

including cli-5.1.1.

(包括cli-5.1.1。)

If however, your version is before 4.0.0, let use say 3.5.0 or 3.7.0, then you will not have to add the white-list requirement.

(但是,如果您的版本在4.0.0之前,请使用3.5.0或3.7.0,那么您将不必添加白名单要求。)

To be clear, the "whitelist" has been around for a bit, but the plugin and requirement is very new.

(需要明确的是,“白名单”已经存在了一段时间,但是插件和要求是非常新的。)

As you would expect, when the "whitelist" was added, the defacto open-access feature was deprecated.

(如您所料,添加“白名单”后,事实上的开放式访问功能已被弃用。)

Or said another way, the defacto open-access feature was planned and scheduled to be eliminated.

(或者说另一种方式,事实上的开放式访问功能已被计划并计划取消。)

This change marks a step in removal of the open-access feature.

(此更改标志着取消了开放式访问功能的一步。)

In addition, the Content Security Policy (CSP) has caught numerous developers - because it was soooo poorly publicized.

(此外,内容安全政策(CSP)吸引了众多开发人员-因为它的宣传不力。)

This CSP needs to go in every single HTML page you used, just like you have to wait for 'deviceready'.

(该CSP需要进入您使用的每个HTML页面,就像您必须等待“ deviceready”一样。)

The documentation is buried in the bottom of many of the latest documentation pages.

(该文档埋在许多最新文档页面的底部。)

(Related Links)

((相关链接)

)

Phonegap Build Forum: Notes for upgrading to cli-5.1.1 on PGB and now required Whitelist

(Phonegap Build论坛: 在PGB上升级到cli-5.1.1的注意事项 ,现在需要白名单)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...