0

const express = require('express') const app = express() const port = 9093

app.get('/', (req, res) => { res.send('Hello World!') })

app.listen(port, () => { console.log(Example app listening on port ${port}) })

this is node sample code

Request is sent successfully through local host but timeouts to connecting through the instance IP.

This is the firewall rule. I have tried targeting applying rule to the instance Label. Also tried applying it to all. None worked.

port receives the requested ping

  • My guess is that you did not assign the tag `http-server` to the instance's network tag. https://cloud.google.com/vpc/docs/add-remove-network-tags Note: you changed the port number for `http-server` to 9093. Leave that rule as port 80 and create a new firewall rule and tag for port 9093. – John Hanley Aug 25 '22 at 09:37
  • I have tried that too. The same result for my other instances too. I created a newer instance to rule other thing out. The instance does respond to every port used in NodeJS code, didn't even had to add rules for it. – swapnil kakulate Aug 25 '22 at 12:59
  • Setting the network tags is a requirement, not something you try. Edit your question with details on the VM's network tags and the matching Firewall rule. Check if you have the UFW firewall enabled. – John Hanley Aug 25 '22 at 21:06

0 Answers0