ethereum icon indicating copy to clipboard operation
ethereum copied to clipboard

I want to use port 443.

Open ttb-inc opened this issue 3 years ago • 7 comments

Hi

I want to use port 443 at url. but, code if (!puri.hasPort) in Ethereum::_validateUri() dose not work.

I had setting port 443, but .hasPort is always false. How can I use 443 port?

Thank you.

ttb-inc avatar Apr 19 '21 04:04 ttb-inc

Setting the port to 443 should be OK but you can't use https if that is what you are trying to do, the scheme has to be http, this test works OK -

 test('connectParameters - OK with port', () {
      client.connectParameters(Ethereum.rpcHttpScheme, 'localhost', 443);
      expect(client.host, 'localhost');
      expect(client.port, 443);
    });

Please post your code.

shamblett avatar Apr 19 '21 14:04 shamblett

Thank you for your comment.

I have to use https. Can I use an external url? For example, https://mainnet.infura.io/v3/...

Now I am testing by overriding EthereumINetworkAdapter. ^^

Thank you.

ttb-inc avatar Apr 20 '21 02:04 ttb-inc

To use https you normally have to use TLS and secure sockets. Ethereum doesn't have a secure sockets adapter this is why https is disallowed, you can't use any url with https in it.

shamblett avatar Apr 20 '21 05:04 shamblett

So, can i use this lib for request balance from infura ?

weixuefeng avatar May 13 '22 03:05 weixuefeng

I don't know what infura is but as stated above this package does not support secure sockets so TLS working on port 443 will not work.

shamblett avatar May 13 '22 05:05 shamblett

I don't know what infura is but as stated above this package does not support secure sockets so TLS working on port 443 will not work.

cool! infura provide public proxy. you can getBalance, sendRawTransaction.. without build your geth node. i want to build a wallet app with ethereum lib. and i have not myself eth rpc node.

weixuefeng avatar May 13 '22 08:05 weixuefeng

i'll add TLS support based on this repo. thanks very much!

weixuefeng avatar May 13 '22 08:05 weixuefeng