having difficulty connecting to an IP address from heroku

Trying to send a ping to an IP address has been successful while testing the application on localhost.

getAsync('ping google.com').then(data => {
       res.send(data);   
    });

When tested on localhost, the result is:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

However, when hosting this code on Heroku ... errors appear in the logs:

{ Error: Command failed: ping google.com
  /bin/sh: 1: ping: not found
  at ChildProcess.exithandler (child_process.js:275:12)

The purpose of this application is to remotely execute a .exe file located on the machine with that IP address.

Answer №1

192.168.x.x represents a range of IP addresses designated for private networks, as described on Wikipedia. Attempting to ping these addresses from outside your private network (such as a LAN) will not be successful.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ways to incorporate JSON web token into every query string of my requests

Just recently, I grasped the concept of using JSON web tokens. Successfully, I can generate a JSON web token upon sign-in and have also established the middleware to authenticate my token and secure the routes that fall under the JSON verification middlewa ...

The issue of receiving a 500 error when making a POST request in node.js

I have created my own unique REST API that utilizes an NLP API internally. I need to post data on their URL, but unfortunately I am encountering an error that is causing my API to return a 500 error to the frontend. Below is a snippet of my server.js code ...

Guide to iterating within a loop with a variable number of iterations above or below the specified amount in JavaScript

I am currently engaged in a project for a small theater group, and I am facing challenges with getting this loop to execute properly. <% include ../partials/header %> <div class="jumbotron jumbotron-fluid"> <div class="container"> ...

Loopback issue: Access Denied

I'm facing an issue with my loopback app that uses mongoDB. When logging in as Admin, I'm unable to use the post method on dishes and receive an authorization required error. The only way to make it work is by changing the dishes role to ALLOW ev ...

Guide on sending a JSON response in error handling Middleware on NodeJS with Express?

Looking for guidance on how to send a JSON response from errorHandler Middleware in NodeJS using Express. Here's an example of my code: UserController.js const UserService = require("..."); exports.createUser = async (req, res) => { try { ...

Establishing a user session with Node.js

I am new to the world of node.js and JavaScript in general. I have a piece of code that currently handles login functionality by checking if a user exists in a MYSQL database. This part is functioning correctly. Now, I wish to improve this feature by crea ...

Issue with dependencies resolution in Nest framework

While delving into NestJS dependencies, I encountered an issue. As a beginner in learning Nest, I am still trying to grasp the correct way to structure everything. The problem lies in Nest's inability to resolve dependencies of the ChatGateway. It&a ...

Error in Node.js: The res.send method is undefined

I'm having some issues with my first attempt at creating a simple Counter Strike API bot using nodeJS. The problem lies with the res.send function, as I keep getting an error message saying "res.send is not a function" every time I try to use it. Movi ...

Determine the absolute path with respect to a different reference path, rather than the current working directory

One of the challenges I'm facing with my Node.js module is how to easily allow developers to edit the location of the dependencies relative to the module file itself. The issue arises because the current working directory, accessed through `process.cw ...

Plow through the contents of the S3 Bucket, exploring every Folder and File

I've encountered an issue while iterating through an S3 bucket using s3.listObjects. The error message { [UnexpectedParameter: Unexpected key 'Key' found in params] has been popping up. Below is the snippet of code I'm currently working ...

Undefined Return Value from Node's Exports Function

I have a function that exports data and is supposed to return a JSON array of draft results. However, when I try to access the draft_results variable in the route provided below in app.js, it shows as undefined. app.get('/draft-results', functio ...

"Utilizing JSON parsing in Node.js and rendering the data in a Jade template

I need assistance with parsing JSON and presenting the response in a tabular format using Jade. Can you help me display the key-value pairs in two separate columns? Node.js exports.postMQinput = function(req, res) { req.assert('name', 'Q ...

Utilizing the Global Module in NestJs: A Step-by-Step Guide

My current project is built using NestJS for the back-end. I recently discovered that in NestJS, we have the ability to create Global Modules. Here is an example of how my global module is structured: //Module import {Global, Module} from "@nestjs/commo ...

As I work on developing a React app, I keep encountering this specific error

C:\Users\souvik das>cd documents C:\Users\souvik das\Documents>npx create-react-app blog Creating a new React app in C:\Users\souvik das\Documents\blog. Installing packages. This may take some time. Ins ...

Tips for maintaining ajax headers and enabling CORS in Angular resource requests

Within my ng-resource files, I have configured the ajax header as follows: var app = angular.module('custom_resource', ['ngResource']) app.config(['$httpProvider', function($httpProvider) { //enable XMLHttpRequest, indic ...

The MongoClient object does not possess the 'open' method

I recently started working on a project using Node.js, Express.js, and MongoDB. I've encountered some issues while trying to set up the database configuration. Below is a snippet of code from my index.js file: var http = require('http'), ...

The Node.js Express framework automatically refreshes the server to update static resources whenever changes are detected

I have configured static resources using express import * as express from "express"; const app = express(); const port = 3000; app.use(express.static("./static")); app.listen(port, () => { console.log(`listening at http://localho ...

What steps do I need to take to ensure that User.findByIdAndUpdate is executed only after the new password has been successfully set?

My code is intended to allow users to change their passwords when they want, but it seems that the hashing of the new password isn't working as expected. The issue appears to be related to the asynchronous nature of promises in JavaScript, where the l ...

Vue CLI Plugin Electron Builder displays a completely empty screen after compiling

After building my electron app using this specific plugin, I encountered a frustrating issue where the installed package would only display a blank, white screen. Despite setting up the window to open dev tools in the built version, inspecting the page rev ...

The issue of receiving a "collection is not a function" TypeError often arises when trying to link MongoDB and NodeJS together

I am a newcomer to MongoDB and currently working on establishing a connection between my ExpressJS server and a MongoDB database. Below is the code I have written for this purpose: const PRIMARY_SERVER = "mongodb://localhost:27017/"; const { M ...