是否可以在端口 80 上使用 Realm Mobile Platform 同步服务器?

Is it possible to use Realm Mobile Platform sync server on port 80?

我想通过 public wifi 使用 Realm Mobile Platform 同步服务器,防火墙只打开端口 80。

是否可以将 Realm 移动平台(Realm 对象服务器)和客户端 API 配置为跨端口 80 而不是默认的 9080 工作?

是的。可以通过适当设置 configuration.yml 来更改端口。

请参阅 proxynetworksync 部分 configuration.yml

以下是configuration.yml的节选。

...
proxy:

  http:
    listen_address: '::'

    ## The port that the HTTP proxy module should bind to.
    # listen_port: 9080

  https:
    ## The port that the HTTPS proxy module should bind to.
    # listen_port: 9443

network:
  http:
    ## The port on which to listen for incoming requests to the Dashboard
    ## and authentication APIs. This defaults to 27080.
    # listen_port: 27080

sync:
  ## Synchronization service settings, including clustering and load balancing.
  servers:
...

docs 说:

You must also choose a port number above 1024, as the Realm Object Server does not run as root. It is recommended to use the default port (9443).

If you would like to be able to connect to Realm Object Server on a port lower than 1024, such as the default HTTPS port 443, you can forward traffic to the port that Realm Object Server is listening on:

sudo iptables -A PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-port 9443

因此要使用端口 80 成功连接,您可以保留默认的 http。 listen_port 在 9080 和 运行 这个命令:

sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 9080