question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request timed out for javascript but not for python

See original GitHub issue
  • OS: macOS Majove 10.14.4
  • Programming Language version: Node (v11.14.0), python (2.7.16)
  • CCXT version: 1.18.667
  • Exchange: okex3
  • Method: fetchMarkets()

With the following javascript snippet the method fetchMarkets always throws error RequestTimeout with default parameters (10000ms for timeout).

#!/usr/bin/env node
const ccxt = require('ccxt')

var client = new ccxt.okex3()
client.fetchMarkets().then(function (markets) { 
  markets.forEach(function (market) {
    console.log(market)
  })
}).catch(function (e) {
  console.log("fetch failed\n", e)
})

However, in python the code works fine.

import ccxt 

client  = ccxt.okex3()
print(client.fetchMarkets())

Possible reasons might be the VPN I am using. But since the VPN runs in global mode, requests from both javascript and python should be forwarded in the same way.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
QuRyucommented, Jun 11, 2019

@kroitor I see. Looking up the routing tables sounds like a plan. I’ll work on that part later on to see how Node interacts with the VPN. Thank you so much!

1reaction
kroitorcommented, Jun 11, 2019

Could it be any problem related to the javascript API or Node.js?

I don’t think so… It wouldn’t work for me with VPN if Node was the reason…

Can you check with a CORS proxy, to see if it makes a difference:

var client = new ccxt.okex3({
    'proxy': 'https://cors-anywhere.herokuapp.com/',
    'origin': 'https://www.okex.com/',
})

?

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Read Time out when attempting to request a page
It looks like your are making 1 request every 2 seconds. For some websites this is fine, others could be call this a...
Read more >
Timeouts in Python requests - Datagy
In this tutorial, you'll learn how to use timeouts in the Python requests library, when working with any type of HTTP request being...
Read more >
Troubleshoot Azure Cosmos DB HTTP 408 or request timeout ...
The HTTP 408 error occurs if the SDK was unable to complete the request before the timeout limit occurred. It is important to...
Read more >
Troubleshoot failing health checks for Application Load ... - AWS
Description: Request timed out. Resolution: If you can connect, then the target page might not respond before the health check timeout period.
Read more >
Common problems | APM Server Reference [7.15] - Elastic
I/O Timeouts can occur when your timeout settings across the stack are not configured correctly, especially when using a load balancer. You may...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found