When behind a proxy you need to make the following modifications (as explained in this answer):
- put the proxy host in the
host
parameter - put the proxy port in the
port
parameter - put the full destination URL in the
path
parameter :
Which gives:
var options = {
host: '<PROXY_HOST>',
port: '<PROXY_PORT>',
path: 'http://www.boardgamegeek.com/xmlapi/boardgame/1?stats=1',
method: 'GET',
headers: {
Host: 'www.boardgamegeek.com'
}
}
总结 你本地开启了代理,把代理关掉就好了