Reputation: 868
I am using Ruby's net/http library to send RESTful requests to my dev server. I've been having issues correctly parsing the data I'm sending in the request and so I'm not looking into ways to inspect the request I'm sending out through Ruby.
On another question I posted here, asking how JSON data was sent in an http request, I received a comment saying that I could possibly inspect the request by using TCPMon. In order to use TCPMon though to check the request, I need to know which port to look for the request on.
And that brings me here. What port does Ruby (and net/http) use to send out HTTP requests?
Upvotes: 0
Views: 1013
Reputation: 164809
The standard port for HTTP is port 80. If you don't specify a port in the URL, that's what it will use.
There's nothing special about port 80, it's just the standard for HTTP. You can run your server on any numeric port you want, test servers often run on something like 8080 or 8000, but you'll have to ensure your clients are connecting to that port.
Here's a list of standard TCP and UDP ports.
Upvotes: 1
Reputation: 410662
Unless otherwise specified, it will make requests to port 80 for http requests, and port 443 for https requests (the standard http/https ports).
However, you'll set up TCPMon to listen to requests on a certain port, and then forward them on to their destination. So if TCPMon is listening on 8080, you'll make the requests to port 8080.
Upvotes: 3