2

I need to create a client, and a server using Go; both reside on two different VM on the cloud. My question is, how do we make a request (say post) from client to server? I am not looking for a code, etc. I am trying to build my understanding before I start coding.

I guess I need to run the tls server with a self-signed certificate and start the POST request from the client code by passing the certificate. Am I correct? Can I request like:

client.Get(PUBLIC_IP_ADDRESS_OF_VM1:PORT_NUMBER)
  • 1
    The exact details will depend on your cloud service provider, so you'll be better off looking at the documentation. For instance, in GCP, your VM could be in a VPC, and it will have an internal IP accessible by other VMs within the VPC. It might also have an external IP accessible from outside the VPC. If you need to access it from the external IP, you'll probably need some sort of firewall / forwarding rules. But in general, yes; your VM will be exposed by some endpoint with an IP and port number. Nothing special needs to be done on the client side -- just in network configuration. – Alexander Guyer Jun 03 '22 at 15:23

0 Answers0