I am trying to connect to CME's API site but I keep getting an error "Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))"
import requests
from requests.auth import HTTPBasicAuth
BASE_URL = "https://amsapinr.cmegroup.com"
r=requests.get(BASE_URL + "/rest/v1/myFirms", auth=HTTPBasicAuth("ID", "PASSWORD"))
print(r)
When I add the url https://amsapinr.cmegroup.com/rest/v1/myFirms in my web browser it prompts me to log in and is successful when i use my credentials.
Related
I try to connect a socket-io with flutter. Before, our server-side developer give me an URL without SSL-Certificate and everything is worked. But now, our server has SSL-Certificate, I can't connect to that socket-io. This is my code to connect:
Socket socket = io(
'wss://server-address',
OptionBuilder()
.setTransports(['websocket'])
.disableAutoConnect()
.build());
socket.connect();
socket.onConnect((_) {
print('socket connect');
});
socket.onConnectError((data) => print('socket error = ' + data.toString()));
I get this error:
socket error = {msg: websocket error, desc: null, type: TransportError}
I try to deploy my web application on a secure host like firebase but still have problems. In inspect of firefox, I also see this error:
Firefox cant establish a connection to the server
How to fix this problem? How to connect to secure socket-io address in flutter web?
I want to use a web socket on Flutter.
I can easily connect to non-SSL API. But when connecting to an API with SSL get the following error.
WebSocketChannelException: WebSocketChannelException:
HandshakeException: Handshake error in client (OS Error:
WRONG_VERSION_NUMBER(tls_record.cc:242))
I tried using SecureSocket, but it doesn't allow adding parameters in SecureSocket.
i'm currently using sails.js and i deploy it in a2hosting shared hosting with turbo plan , i'm trying to connect to the sails socket in (ionic /angular) app i used the nodejs script for sails.io.js and socket.io.js from this documentation from here
and this is my configuration in my ionic app
this.io = sailsIOClient(socketIOClient);
this.io.sails.url = 'https://example.com/api';
this.io.sails.path = '/api';
this.io.sails.environment = 'production';
this.io.sails.useCORSRouteToGetCookie = false;
and every time trying to connect this errors appear
websocket.js:110 WebSocket connection to 'wss://example.com/api/?__sails_io_sdk_version=1.2.1&__sails_io_sdk_platform=node&__sails_io_sdk_language=javascript&EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 404
any one can help me please ?
I'm using a simple perl script to try and download a file from the following URL:
http://www.londonstockexchange.com/products-and-services/trading-services/setsqx/ccp-securities.xls
use File::Fetch;
my $url = 'http://www.londonstockexchange.com/products-and-services/trading-services/setsqx/ccp-securities.xls';
my $ff = File::Fetch->new(uri => $url);
my $file = $ff->fetch() or die $ff->error;
I am getting:
Fetch failed! HTTP response: 500 Internal Server Error [500 Can't connect to www.londonstockexchange.com:80 (connect: Connection refused)]
Could not open socket to 'www.londonstockexchange.com', 'Connection refused
Any ideas how i can get past this?
Could not open socket to 'www.londonstockexchange.com', 'Connection refused
Any ideas how i can get past this?
Direct connection to this site is blocked somewhere.
If you are inside a company there is probably a firewall and some proxy you are required to use. Ask your system administrator.
profile=urllib2.urlopen("https://www.graph.facebook.com/v2.0/me?access_token="+access_token)
In this code error=
'An error occured while connecting to the server: %s' % e) error: An
error occured while connecting to the server: DNS lookup failed for
URL:
https://www.graph.facebook.com/v2.0/me?access_token=CAACEdEose0cBALIUnSI0kzOCoom0ole1kGNsPsZA9lSaxZAxOz56wHJTUhoG1a3zC7kRH3BrWcL5XtZAjzrUCVesgE6tqOOiAzMeS2JGEtcL51pgQJ697n96YogVE9wVhoiGs9uN40Y7XDRRM60ZCYHC1gJF9I6stTDFZBoKE0KEMc3RFYPRrPzUM264BIZD
You have added an extra www. to the URL
The code should look like this:
profile=urllib2.urlopen("https://graph.facebook.com/v2.0/me?access_token="+access_token)