Google maps 来自中国IPv6的谷歌地理编码API

Google maps 来自中国IPv6的谷歌地理编码API,google-maps,google-geocoding-api,Google Maps,Google Geocoding Api,当从我们在上海的服务器访问地理编码api时,它连接到IPv6,但我们的提供商不支持它,请求失败 然而,当从欧洲或美国访问时,它只连接到IPv4,工作正常 这是上海服务器的输出 curl -v -IL 'http://maps.googleapis.com/maps/api/geocode/json' * About to connect() to maps.googleapis.com port 80 (#0) * Trying 74.125.128.95... Connection time

当从我们在上海的服务器访问地理编码api时,它连接到IPv6,但我们的提供商不支持它,请求失败

然而,当从欧洲或美国访问时,它只连接到IPv4,工作正常

这是上海服务器的输出

curl -v -IL 'http://maps.googleapis.com/maps/api/geocode/json' 
* About to connect() to maps.googleapis.com port 80 (#0)
* Trying 74.125.128.95... Connection timed out
* Trying 2404:6800:4005:c00::5f... Failed to connect to 2404:6800:4005:c00::5f: Network is unreachable
* Success
* couldn't connect to host
* Closing connection #0
curl: (7) Failed to connect to 2404:6800:4005:c00::5f: Network is unreachable
这是欧洲的产出:

curl -v -IL 'http://maps.googleapis.com/maps/api/geocode/json'
* About to connect() to maps.googleapis.com port 80 (#0)
* Trying 173.194.70.95... connected
> HEAD /maps/api/geocode/json HTTP/1.1
> User-Agent: curl/7.22.0 (i686-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: maps.googleapis.com
> Accept: */*
> 
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Type: application/json; charset=UTF-8
Content-Type: application/json; charset=UTF-8
< Date: Fri, 13 Jun 2014 11:50:43 GMT
Date: Fri, 13 Jun 2014 11:50:43 GMT
< Expires: Sat, 14 Jun 2014 11:50:43 GMT
Expires: Sat, 14 Jun 2014 11:50:43 GMT
< Cache-Control: public, max-age=86400
Cache-Control: public, max-age=86400
< Vary: Accept-Language
Vary: Accept-Language
< Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
< Server: mafe
Server: mafe
< X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
X-Frame-Options: SAMEORIGIN
< Alternate-Protocol: 80:quic
Alternate-Protocol: 80:quic
< Transfer-Encoding: chunked
Transfer-Encoding: chunked

< 
* Connection #0 to host maps.googleapis.com left intact
* Closing connection #0
curl-v-IL'http://maps.googleapis.com/maps/api/geocode/json'
*即将连接()到maps.googleapis.com端口80(#0)
*正在尝试173.194.70.95。。。有联系的
>HEAD/maps/api/geocode/json HTTP/1.1
>用户代理:curl/7.22.0(i686 pc linux gnu)libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
>主持人:maps.googleapis.com
>接受:*/*
> 
如果其他人有这个问题,下面是谷歌支持部门的回复


是的,要从中国访问谷歌地图,请使用“ditu.Google.cn”域名而不是“Maps.googleapis.com”

例如: