windows postgresql 和防火墙

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2307700/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:59:58  来源:igfitidea点击:

postgresql and firewall

windowswcfpostgresqlclient-server

提问by Warpin

I will be building a server/client software on Windows, where many machines need to communicate with a Postresql database running on the server. This is C++ software so I will use libpq to connect to the database.

我将在 Windows 上构建服务器/客户端软件,其中许多机器需要与服务器上运行的 Postresql 数据库进行通信。这是 C++ 软件,所以我将使用 libpq 连接到数据库。

If I do this, will there be issues with the firewall? I'd like to make configuration as easy as possible and not have users open up firewall ports or disable their firewall.

如果我这样做,防火墙会出现问题吗?我想让配置尽可能简单,而不是让用户打开防火墙端口或禁用他们的防火墙。

If I do need to open up firewall ports, can I use WCF to get around the issue? Basically send a command to the server using WCF, run the postgresql command locally, and get the result back (I have never used WCF but understand that it can communication using HTTP port 80).

如果我确实需要打开防火墙端口,我可以使用 WCF 来解决这个问题吗?基本上使用 WCF 向服务器发送命令,在本地运行 postgresql 命令,然后返回结果(我从未使用过 WCF,但知道它可以使用 HTTP 端口 80 进行通信)。

采纳答案by Matt Solnit

PostgreSQL typically listens on port 5432, which is not open by default in the Windows firewall. But the only machine where the firewall would need to be re-configured is the one where PostgreSQL is running. If you have many client machines, none of them should require firewall changes (unless they have restrictions on outboundtraffic, which is rare).

PostgreSQL 通常侦听端口 5432,该端口在 Windows 防火墙中默认未打开。但是唯一需要重新配置防火墙的机器是运行 PostgreSQL 的机器。如果您有很多客户端机器,它们都不需要更改防火墙(除非它们对出站流量有限制,这种情况很少见)。

Hope this helps.

希望这可以帮助。

回答by Joshua D. Drake

You can also configure SSL connections to ensure better security.

您还可以配置 SSL 连接以确保更好的安全性。