Supabase & Your Network: IPv4 and IPv6 compatibility
与你的 Supabase 数据库的网络兼容性 #
🌐 Network compatibility with your Supabase database
互联网使用一种叫做互联网协议(IP)的系统在设备之间传输信息。主要有两个版本:
🌐 The internet uses a system called the Internet Protocol (IP) to route communication between devices. There are two main versions:
- IPv4:1980年推出,它是最初的版本。
- IPv6:于1999年推出,它提供了更大的地址空间,是更具未来保障的首选。
Supabase 和 IPv6 #
🌐 Supabase and IPv6
所有 Supabase 数据库都提供一个直接连接字符串,它映射到一个 IPv6 地址。
🌐 All Supabase databases provide a direct connection string that maps to an IPv6 address.
与不兼容 IPv6 的主机一起工作 #
🌐 Working with IPv6 incompatible hosts
如果你的服务器平台不支持 IPv6,这里有几种选择:
🌐 Here are your options if your server platform doesn't support IPv6:
- 使用 Supavisor 连接字符串(可在 仪表板 中找到)。
- 使用 Supabase 客户端库,它们兼容 IPv4。
- 启用 专用 IPv4 附加功能(适用于 Pro 及以上级别的组织)
注意:IPv4 附加组件每小时费用为 $0.0055 ,如果整个月(约720小时)使用,大约为$4.00
正在检查 IPv6 支持 #
🌐 Checking IPv6 support
大多数服务都兼容IPv6。不过,有一些主要服务只接受IPv4连接:
🌐 The majority of services are IPv6 compatible. However, there are a few prominent ones that only accept IPv4 connections:
如果你还不确定你的网络是否支持 IPv6,你可以在部署服务器上运行这个 cURL 命令:
🌐 If you're still unsure if your network supports IPv6, you can run this cURL command on your deployment server:
1curl -6 https://ifconfig.co/ip如果命令返回一个IPv6地址,说明网络支持IPv6。
🌐 If the command returns an IPv6 address, the network is IPv6 compatible.
查找你的数据库 IP 地址 #
🌐 Finding your database's IP address
要确定你当前的IP地址,你可以使用IP地址查询网站或终端命令:
🌐 To determine your current IP address, you can use an IP address lookup website or the terminal command:
1nslookup db.<PROJECT_REF>.supabase.co这个命令会查询域名服务器,以找到给定主机名的IP地址。
🌐 This command queries the domain name servers to find the IP address of the given hostname.
示例 IPv6 地址:2a05:d014:1c06:5f0c:d7a9:8616:bee2:30df
🌐 Example IPv6 Address: 2a05:d014:1c06:5f0c:d7a9:8616:bee2:30df
识别你的人脉 #
🌐 Identifying your connections
通过点击仪表板上的 Connect,可以找到连接池和直接连接字符串。
🌐 The pooler and direct connection strings can be found on the dashboard by clicking Connect.
“默认情况下,Note 使用 IPv6 地址”
1# Example connection string2postgresql://postgres:[YOUR-PASSWORD]@db.ajrbwkcuthywfihaarmflo.supabase.co:5432/postgres交易模式下的Supavisor(端口6543) #
🌐 Supavisor in transaction mode (port 6543)
1# Example transaction string2postgresql://postgres.ajrbwkcuthywddfihrmflo:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgresSupavisor 正在会话模式(端口 5432) #
🌐 Supavisor in session mode (port 5432)
1# Example session string2postgresql://postgres.ajrbwkcuthywfddihrmflo:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres