简体   繁体   English

解析服务器将无法连接到自托管

[英]Parse Server Will Not Connect to Self-Hosted

I have a Ubuntu parse server hosted with MongoDB, I got my database switched over, and everything looks good. 我有一台由MongoDB托管的Ubuntu分析服务器,我的数据库已切换,一切看起来都很好。 Parse Dashboard, able to get to the ports. 解析仪表板,能够访问端口。 But now when I try to get my app to start loading from there, it does nothing. 但是现在,当我尝试让我的应用从那里开始加载时,它什么也没做。 I get a blank white screen and thats it. 我得到一个空白的白色屏幕,仅此而已。 Even though all the data is now loading from my parse server self hosted anyways. 即使所有数据现在都从我自己托管的解析服务器加载。

I have checked that everything is running right, port 1337 is npm start from the parse server. 我检查了一切是否运行正确,端口1337是从解析服务器启动的npm。

This is the code I'm using: 这是我正在使用的代码:

let parseConfiguration = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in
        ParseMutableClientConfiguration.applicationId = "inSparkle"
        ParseMutableClientConfiguration.clientKey = "CLIENT_KEY"
        ParseMutableClientConfiguration.server = "http://10.0.1.9:1337/parse"
    })

    Parse.initializeWithConfiguration(parseConfiguration)

Any help would be greatly appreciated! 任何帮助将不胜感激! I am really confused by this because 10.0.1.9:1337 says "I dream of being a website. Please star the parse-server repo on GitHub!" 我对此感到非常困惑,因为10.0.1.9:1337说:“我梦想成为一个网站。请在GitHub上对解析服务器存储库加注星标!”

Mongo is running, as well as dashboard all on their own ports. Mongo以及仪表板都在自己的端口上运行。 I can even access the dashboard from the iPad I'm testing with. 我什至可以从进行测试的iPad上访问仪表板。 Just not my app. 只是不是我的应用程序。

My guess is that iOS blocks your calls to Parse because the connection to your server is not secured (by default, iOS prohibits any HTTP connections without SSL/TLS encryption). 我的猜测是,iOS阻止了您对Parse的调用,因为与服务器的连接不安全(默认情况下,iOS禁止任何未经SSL / TLS加密的HTTP连接)。

For testing purpose, you can add this to your Info.plist : 为了进行测试,您可以将其添加到您的Info.plist

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

In the production build, NSAllowsArbitraryLoads should of course not be enabled, instead you should access Parse over a secure connection. 在生产版本中,当然不应启用NSAllowsArbitraryLoads ,而应通过安全连接访问Parse。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM