Skip to content

Commit

Permalink
Merge pull request #7 from h8is2w8/master
Browse files Browse the repository at this point in the history
Fix port for https in create_ethereum_client
  • Loading branch information
m-bo-one committed Apr 9, 2018
2 parents 98aba32 + eb23e28 commit 620c345
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions aioethereum/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,10 @@ def create_ethereum_client(uri, timeout=60, *, loop=None):
loop=loop)
return AsyncIOIPCClient(reader, writer, uri, timeout, loop=loop)
elif presult.scheme in ('http', 'https'):
tls = False
if presult.scheme[-1] == 's':
tls = True
tls = presult.scheme[-1] == 's'
netloc = presult.netloc.split(':')
if len(netloc) == 1:
host, port = netloc[0], 80
else:
host, port = netloc
host = netloc.pop(0)
port = netloc.pop(0) if netloc else (443 if tls else 80)
return AsyncIOHTTPClient(host, port, tls, timeout, loop=loop)
else:
raise RuntimeError('This scheme does not supported.')

0 comments on commit 620c345

Please sign in to comment.