Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_EMPTY_RESPONSE every time i try to access from a device not local #5008

Open
jman13378 opened this issue Oct 2, 2022 · 16 comments
Open

Comments

@jman13378
Copy link

jman13378 commented Oct 2, 2022

so im trying to create an express server but i get ERR_EMPTY_RESPONSE(from a VPN) on other devices and my friends got ERR_CONNECTION_TIMED_OUT

how can i fix this

@enyoghasim
Copy link
Member

can you help with a screenshot i want to confim something

@jman13378
Copy link
Author

jman13378 commented Oct 4, 2022

Screenshot_20221004_181614

const express = require('express')
const app = express()
const fs = require('fs')
app.use(express.static('public'))
var lel = app.get('/', function (req, res) {
}).get('/site', function (req, res) {
  fs.readFile('./public/site.html', async function(err, data) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.write(data);
    return res.end();
  });
  

}).get('/api/get/guilds', async function (req, res) {
  res.send(`${await client.guilds.cache.size}`)
}).get('/api/get/members', async function (req, res) {
  res.send(`${await client.users.cache.size}`)

}).get('/api/get', function (req, res) {
  fs.readFile('./public/api/get/', async function(err, data) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.write(data);
    return res.end();
  });

}).listen(port,"0.0.0.0", ()=>{
  console.log(`Listening port on ${lel.address().port}`)
});

@enyoghasim
Copy link
Member

enyoghasim commented Oct 4, 2022

sorry for asking is the ip a publicly accessible ip address?

or that of localhost

@jman13378
Copy link
Author

jman13378 commented Oct 4, 2022

that was my pc's ipv4 but my public ip address does the same thing. My ipv4, localhost, and public address work on local devices

@enyoghasim
Copy link
Member

ok can you try using ngrok to expose the local port and lets see how that goes?

@jman13378
Copy link
Author

it works but i would rather use my ip

@enyoghasim
Copy link
Member

i guess the main issue is the ip adress.

i guess its not being exposed

@dougwilson
Copy link
Contributor

It is also possible there is a firewall involved, either on the device itself or the network between the two machines. If you are able to at least get a reaponse on loopback (i.e. 127.0.0.1), then the issue is outside of the express.js framework and something network, machine, or node.js.

@jman13378
Copy link
Author

image
image
image

@dougwilson
Copy link
Contributor

Hi @jman13378 I am certainly sorry you are having trouble. It is unfortunately we are not sure what the issue is exactly that you are experiencing and we are not also experiencing. That puts us in a hard place to help. If you believe this is an issue in Express.js, it may help if you can help provide pointers for where you are seeing the issue in our code and we can perhaps work towards what code changes we need to make, or you're always welcome to contribute such a change directly. Other than that, I'm not sure how else we can help.

@enyoghasim
Copy link
Member

It is also possible there is a firewall involved, either on the device itself or the network between the two machines. If you are able to at least get a reaponse on loopback (i.e. 127.0.0.1), then the issue is outside of the express.js framework and something network, machine, or node.js.

yea @dougwilson because ngrok also works according to him

@dougwilson
Copy link
Contributor

Well, here is a test @jman13378 : see if the following code has the same issue or not. This will narrow down for if the Express.js project can assist or not:

const http = require('http')
const app = http.createServer((req, res) => res.end('Hello, world!'))
app.listen(3000, "0.0.0.0")

@jman13378
Copy link
Author

const http = require('http')
const app = http.createServer((req, res) => res.end('Hello, world!'))
app.listen(3000, "0.0.0.0")

not that

@jman13378
Copy link
Author

its most likely an ISP issue or Firewall

@sheplu
Copy link
Member

sheplu commented Oct 19, 2022

were you able to solve the issue ? or is it still not working ?

Looking on my side like other people said it is most likely some kind of firewall / blocking the request

@jman13378
Copy link
Author

I will try in my pi but other than that I have not fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants