ecency / hivesigner-sdk

Hivesigner SDK
https://hivesigner.com
MIT License
2 stars 1 forks source link

FetchErrorr request to: https://hivesigner.com/api/me failed, reason: connect EHOSTUNREACH 104.21.44.94:443 #15

Open BartolomeoItaliano opened 2 years ago

BartolomeoItaliano commented 2 years ago

When making requests to https://hivesigner.com/api/me from remote server (with constant IP address) sometimes I receive error like this. The behavior is not regular sometimes I get it for couple of minutes sometimes shorter.

I use hive signer tokens to prove user identity on my server than I save the token and treat it as authorization string for some time. Because, of the behavior mentioned my users are unable to login through hivesigner. What is the case and how to solve it?

That's error I receive:

FetchErrorr request to https://hivesigner.com/api/me failed, reason: connect EHOSTUNREACH 104.21.44.94:443
r: request to https://hivesigner.com/api/me failed, reason: connect EHOSTUNREACH 104.21.44.94:443FetchErrorr request to https://hivesigner.com/api/me failed, reason: connect EHOSTUNREACH 104.21.44.94:443
    at ClientRequest.<anonymous> (/somepath/node_modules/hivesigner/node_modules/node-fetch/lib/index.js:1461:11)
    at ClientRequest.emit (events.js:315:20)
    at TLSSocket.socketErrorListener (_http_client.js:469:9)
    at TLSSocket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  type: 'system',
  errno: 'EHOSTUNREACH',
feruzm commented 2 years ago

@BartolomeoItaliano Can you share example of code that reproduce above error? I am unable to reproduce this.

BartolomeoItaliano commented 2 years ago
        this.sc2Api = new hivesigner.Client({
            app: "myAppName",
            callbackURL: "PageAddress.com",
            scope: ["login"],
        });

            this.sc2Api.setAccessToken(steemConnectToken);
            return await new Promise<boolean>((resolve: any, reject: any) => {
                this.sc2Api.me(
                    async (err: any, response: any) => {
                        if (err) {
                            console.log(err, response);
                            // here I print to logs described error
                            resolve(false);
                        } else {
                            resolve(true);
                        }
                    });
            });

On my local environment I also was not able to reproduce it.

Maybe hivesigner servers rejects my requests for some reason? Could it be possible, that after certain amount of requests it starts to reject further communication?