How to enable HTTP connection in gcloud? - connection refused - http

I tried to enable http connection to gcloud project and when I'm trying to reach an html file on the server, it returns a tcp reset packet (as I saw in wireshark), and on the browser I see the following:
my firewall rules are:
here are my VM Instace details (without the ssh key)
I even checked that ping is working.
Thanks in advance.

Related

Ngrok errors '502 bad gateway' - How to point web server to point 5000

I'm new to Web App so I'm sorry if this is a simple question.
I enter: ngrok http 5000
Then when I go to the correct https address I get the message below.
The connection to https://e71eb98330fe.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address 127.0.0.1:5000.
Make sure that a web service is running on 127.0.0.1:5000 and that it is a valid address.
The error encountered was: dial tcp 127.0.0.1:5000: connect: connection refused
According to this answer:
I need to set up a web server and point it to local host 5000.
But my error is slightly different and even when I try going to: localhost:5000
It doesn't work.
Is the problem just that I need to point a web server to 5000? How do I do that?

Websocket connection opens and closes immediately

I'm using websockets and have managed to successfully set up my war file on the AWS Beanstalk. I am using Nginx as a proxy server and a classic Load Balancer listening on port 80, and the protocol is TCP instead of HTTP. Cross-zone load balancing is enabled and Connection draining is also enabled with the draining timeout as 60 seconds. The logs aren't showing any errors.
I have not changed the default nginx.conf file.
The connection upgrade is happening successfully, with the status code returning '101 Switching Protocol'. I just cannot seem to figure out why the connection is closing immediately.
Any help is appreciated. Thanks.
This wonderful answer helped me solve this problem.
It turns out that the corporate WiFi connection that I was on had a firewall which was immediately terminating my WebSocket connection. It worked perfectly fine when I tried on a different WiFi network that did not have any firewall configured.

Firebase console does not display data

I received this error in my browser console:
WebSocket connection to 'wss://s-usc1c-nss-109.firebaseio.com/.ws?v=5&ns=dashroad-fleet-management' failed: WebSocket is closed before the connection is established.
If I navigate to other projects in Firebase, their data load and display just fine.
Edit 1: New error in browser console upon page reload:
WebSocket connection to
'wss://s-usc1c-nss-109.firebaseio.com/.ws?v=5&ns=dashroad-fleet-management'
failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED
qh.open #
third_party/javascript/firebase/firebase_js_minified.jslib:176
Edit 2: If I let the browser tab be, eventually the data is loaded once the WebSocket connection is established (the WebSocket Connection error stops appearing)
If this error occurs in chrome, just ignore it. There was a problem with webkit \ chrome, some websocket related issues.
This error can also occur due to malformed URL.
What does Err_name_not_resolved mean?
DNS is the network service that translates a website's name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Google Chrome from accessing the network.
Source google
net::ERR_NAME_NOT_RESOLVED
This seems to DNS resolution problem. Enter DNS servers addresses manually in the Internet Protocol (IP) v4 settings in your computer network settings. Use public DNS addresses such as 8.8.8.8, 8.8.4.4, 4.2.2.2 etc.

How do I channel all browsing traffic through encrypted sTunnel session?

I have sTunnel running on my client and server and can't seem to get my head round how I can have it running in a sort of "silent mode" whereby if I were abroad I could fire up the sTunnel connection on my client, connect to my server and then my browsing traffic connection would behave as if I were in the UK (an encrypted proxy).
On the client conf I have:
accept = localhost:xxx (I understand this means the local sTunnel installation listens on xxx port and grabs any traffic sent on that port).
connect = serverip:xxx (This is the instruction of where it needs to be forwarded, i.e the server).
On my server:
accept: clientIP:xxx (the source IP address of my client)
connect: localhost:xxx (the loopback address of the server)
What am I failing to see here? As I see it I can only use this tunnel if I explicitly target a port with my browser and even then wouldn't it only make it as far as the sTunnel server and not onward to the website intended? Do I need to setup proxy settings in the browser?
thanks a lot
I'm not sure stunnel is what you're looking for here.
What you describe would be best accomplished with OpenSSH, and its dynamic SOCKS5 proxy functionality, e.g. ssh -D1080 from the client.
This generally doesn't require any extra settings on the server-side (unless it was specifically disabled by your system administrator), and then on your roaming client-side, you simply establish an SSH connection to your server as per usual, but add an extra -D1080 parameter to your ssh invocation.
Or, if using PuTTY, set up dynamic port forwarding within Connection, SSH, Tunnels, Source port of 1080 and Destination of Dynamic, click Add.
Subsequently, change the settings of your browser to use SOCKS proxy at localhost, port 1080, and also make sure to specify SOCKS v5 and ensure that the checkbox for resolving hostnames remotely is set, too.

Project Zomboid Server Google Compute Engine

I've been trying to set up a server using Google Compute Engine but find myself being stuck.
I've installed everything that needs to be installed, I can start the server, no problem. Only thing is, i'm unable to connect to the server.
I've opened the required ports in a firewall rule (udp:16261; tcp:16262-16270) for all source IP as normal, but when I try to connect, i get this message on the server's console :
User jet is trying to connect.
Connected new client jet ID # 0 and assigned DL port 16262
testing TCP download port 16262
And it waits and waits, nothin happens. I'm pretty sure it's because no connection has been requested from the outsite of the network on that specific port (16262) that the outgoing traffic can't be sent, but I was wondering if anyone else has tried to make it work.
Thanks for your help guys !
According to the documentation; in the "Forwarding Required Ports" Section:
Project Zomboid dedicated servers require the following open ports to successfully connect to clients:
8766 UDP
16261 UDP
If the client's public ip address is known, you can perform a basic troubleshooting whitin Google Compute Engine using Cloud Logging. A basic query returning all the logs containing that ip address as source or destination would be:
jsonPayload.connection.src_ip="public-ip-address" OR jsonPayload.connection.dest_ip="public-ip-address"
Firewall Rules Logging has to be "on" for every rule involved in the connection. Follow these steps for Enabling firewall rules logging.
For troubleshooting purposes an "allow all" Firewall rule can be created and logging enabled on it, that would allow you to see exactly what ports are involved.
Note: If the traffic hitting the firewall rule(s) is too much, it can lead to unanticipated storage costs. Please enable the firewall rules logging just for troubleshooting purposes, don't forget to disable it after you're done.

Resources