[nodejs] Re: Check if internet connection is working behind a proxy

2018-05-02 Thread Zlatko
>From client's perspective, navigator check doesn't care nor sees proxies. It 
>tries to do a connection and that's it.

Alternatively look at what you've got.
Internet-available makes a dns query, but your proxy/firewall does not allow 
direct communication. But a simple http fetch should work, if your app uses 
default system proxy configuration (in vast majority of the cases). So I would 
guess that a combo of no-direct-dns (or anything outgoing, for that matter), 
but normal connection from the client-side script which uses something like 
automatic (OS-controlled) proxy config should tell you it is a proxy.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/a61f88b7-8308-43f7-9590-cd82adb2008d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] Re: Check if internet connection is working behind a proxy

2018-05-02 Thread Mikkel Wilson
Oh, you said this was an electron app. There's a DOM event for network 
connectivity: 
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/Online_and_offline_events

I just tested this with my own electron app and it works. I'm not sure what 
it's doing under the hood, but without knowing what your proxy is doing, 
bypassing it will be a challenge.

> navigator.onLine
  true

[turn off wifi]

> navigator.onLine
  false

Easy! But I'm not behind a proxy...

Mikkel
https://www.oblivious.io/ 

On Wednesday, May 2, 2018 at 9:54:36 AM UTC-7, martink...@gmail.com wrote:
>
> Okay maybe it's not the best module . Do you know a better one? Or do you 
> have a idea how to check it?
> I only want to check if there is a internet connection available.
>
> It's the proxy of my company. So I think only save ports are allowed and 
> the other ones are blocked. But I'm not sure which ports are allowed.
>
> Martin
>
>
>
> Am Montag, 30. April 2018 21:42:46 UTC+2 schrieb Mikkel Wilson:
>>
>> This module is just doing a DNS query. 
>> https://github.com/ourcodeworld/internet-available/blob/master/internet-available.js#L25
>>
>> What is your proxy doing that is blocking port 53?
>>
>> Mikkel
>> https://www.oblivious.io/ 
>>
>>
>> On Monday, April 30, 2018 at 8:43:10 AM UTC-7, martink...@gmail.com 
>> wrote:
>>>
>>> Hey,
>>>
>>> I would like to develop a tool (angular-electron-app) which checks if an 
>>> internet connection exists or not and this behind a proxy.
>>>
>>> So first I tried this module 
>>> https://www.npmjs.com/package/internet-available .
>>> But it does not work because I'm behind a proxy.
>>>
>>> So now I need a module or a solution to check the internet connection 
>>> through my proxy.
>>>
>>> Any ideas?
>>>
>>>
>>> Thank's for help!
>>>
>>>
>>> Martin 
>>>
>>>
>>>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/dbbba579-d02e-4101-969e-b163c373a9ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] Re: Check if internet connection is working behind a proxy

2018-05-02 Thread martinkovacs78
Okay maybe it's not the best module . Do you know a better one? Or do you 
have a idea how to check it?
I only want to check if there is a internet connection available.

It's the proxy of my company. So I think only save ports are allowed and 
the other ones are blocked. But I'm not sure which ports are allowed.

Martin



Am Montag, 30. April 2018 21:42:46 UTC+2 schrieb Mikkel Wilson:
>
> This module is just doing a DNS query. 
> https://github.com/ourcodeworld/internet-available/blob/master/internet-available.js#L25
>
> What is your proxy doing that is blocking port 53?
>
> Mikkel
> https://www.oblivious.io/ 
>
>
> On Monday, April 30, 2018 at 8:43:10 AM UTC-7, martink...@gmail.com wrote:
>>
>> Hey,
>>
>> I would like to develop a tool (angular-electron-app) which checks if an 
>> internet connection exists or not and this behind a proxy.
>>
>> So first I tried this module 
>> https://www.npmjs.com/package/internet-available .
>> But it does not work because I'm behind a proxy.
>>
>> So now I need a module or a solution to check the internet connection 
>> through my proxy.
>>
>> Any ideas?
>>
>>
>> Thank's for help!
>>
>>
>> Martin 
>>
>>
>>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/e2eb0e3d-4188-4e8e-91f0-5e1619e0b9f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.