Git Product home page Git Product logo

Comments (7)

Seikho avatar Seikho commented on August 12, 2024

Hi @YashKharel19
I've just run the tests and added support for https. Everything still seems to be passing locally for me.
Can you try the examples in the tests?

from node-http-ping.

YashKharel19 avatar YashKharel19 commented on August 12, 2024

Hello @Seikho
My Code:
import ping from 'node-http-ping';

ping('https://google.com', 80)
.then(time => console.log(Response time: ${time}ms))
.catch(error => console.log(Failed to ping: ${error}));

output on browser:
https://imgur.com/a/rjj8BmB

from node-http-ping.

Seikho avatar Seikho commented on August 12, 2024

This library is only supported in Node. It won't work in the browser as the http and https Node APIs aren't available in the browser.

from node-http-ping.

YashKharel19 avatar YashKharel19 commented on August 12, 2024

@Seikho
So is their any other way to implement it? Where does it work ?

from node-http-ping.

Seikho avatar Seikho commented on August 12, 2024

It'll work on a NodeJS server.

$ npm install node-http-server
$ + [email protected]
$ node
> require('node-http-server')('google.com').then(console.log)
> ...
> 289

from node-http-ping.

YashKharel19 avatar YashKharel19 commented on August 12, 2024

$ node

require('node-http-server')('google.com').then(console.log)
where do you use this code can you please send me the screenshot.

from node-http-ping.

Jonyk56 avatar Jonyk56 commented on August 12, 2024

you can always use webpack to compile, put on a site, and ping it using the file :P but, it is a long and tiring setup... mostly if you do not know how webpack functions

from node-http-ping.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.