I've been running my ticker-bot to gather order book from Stellar Network. However, it did not work since probably few hours ago.
The bot is tiny program written in Python which just pinging orderbook using curl package.
import pycurl
from io import BytesIO
buffer = BytesIO()
c = pycurl.Curl()
c.setopt(c.URL, 'https://horizon.stellar.org/order_book?selling_asset_type=credit_alphanum4&selling_asset_code=MOBI&selling_asset_issuer=GA6HCMBLTZS5VYYBCATRBRZ3BZJMAFUDKYYF6AH6MVCMGWMRDNSWJPIH&buying_asset_type=native&buying_asset_code=XLM&buying_asset_issuer=native&limit=10')
c.setopt(c.WRITEDATA, buffer)
c.perform()
c.close()
body = buffer.getvalue()
print(body)
The result is, blocked by Cloudflare (masking IP by hands):
b'<!DOCTYPE html>\n<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->\n<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->\n<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->\n<head>\n<title>Access denied | horizon.stellar.org used Cloudflare to restrict access</title>\n<meta charset="UTF-8" />\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />\n<meta name="robots" content="noindex, nofollow" />\n<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />\n<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />\n<!--[if lt IE 9]><link rel="stylesheet" id=\'cf_styles-ie-css\' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->\n<style type="text/css">body{margin:0;padding:0}</style>\n\n\n<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->\n<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script><!--<![endif]-->\n\n\n\n</head>\n<body>\n <div id="cf-wrapper">\n <div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>\n <div id="cf-error-details" class="cf-error-details-wrapper">\n <div class="cf-wrapper cf-header cf-error-overview">\n <h1>\n <span class="cf-error-type" data-translate="error">Error</span>\n <span class="cf-error-code">1010</span>\n <small class="heading-ray-id">Ray ID: 47d875148fa3a56c • 2018-11-22 03:54:53 UTC</small>\n </h1>\n <h2 class="cf-subheadline">Access denied</h2>\n </div><!-- /.header -->\n\n <section></section><!-- spacer -->\n\n <div class="cf-section cf-wrapper">\n <div class="cf-columns two">\n <div class="cf-column">\n <h2 data-translate="what_happened">What happened?</h2>\n <p>The owner of this website (horizon.stellar.org) has banned your access based on your browser\'s signature (47d875148fa3a56c-ua47).</p>\n </div>\n\n \n </div>\n </div><!-- /.section -->\n\n <div class="cf-error-footer cf-wrapper">\n <p>\n <span class="cf-footer-item">Cloudflare Ray ID: <strong>47d875148fa3a56c</strong></span>\n <span class="cf-footer-separator">•</span>\n <span class="cf-footer-item"><span>Your IP</span>: ***.***.***.***</span>\n <span class="cf-footer-separator">•</span>\n <span class="cf-footer-item"><span>Performance & security by</span> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">Cloudflare</a></span>\n \n </p>\n</div><!-- /.error-footer -->\n\n\n </div><!-- /#cf-error-details -->\n </div><!-- /#cf-wrapper -->\n\n <script type="text/javascript">\n window._cf_translation = {};\n \n \n</script>\n\n</body>\n</html>\n'
I heard some kinds of DDOS attack was happened few hours ago. Surely, I'm not a DDOS attacker. I've been pinging above query every seconds and it worked for months. Even when I pinging orderbook by using curl in bash shell same machine, it retrieves orderbook correctly.
# curl "https://horizon.stellar.org/order_book?selling_asset_type=credit_alphanum4&selling_asset_code=MOBI&selling_asset_issuer=GA6HCMBLTZS5VYYBCATRBRZ3BZJMAFUDKYYF6AH6MVCMGWMRDNSWJPIH&buying_asset_type=native&buying_asset_code=XLM&buying_asset_issuer=native&limit=10"
{
"bids": [
{
"price_r": {
"n": 10000000,
"d": 107526881
},
"price": "0.0930000",
"amount": "181.3500000"
},
{
"price_r": {
"n": 927709,
"d": 10000000
},
"price": "0.0927709",
"amount": "4.6195392"
},
...
...
}
Anyone could help this? I will really appreciate for this.