Curl Specify Port

Can curl make a connection to any TCP ports … – Stack Overflow

Can curl make a connection to any TCP ports not just HTTP/HTTPS
I need to check for an open port, for example: 11740.
Is this possible?
asked Dec 6 ’13 at 22:22
Yes, it’s possible, the syntax is curl [protocol][:port], for example:
curl
If you’re using Bash, you can also use pseudo-device /dev files to open a TCP connection, e. g. :
exec 5<>/dev/tcp/127. 0. 1/1234
echo “send some stuff” >&5
cat <&5 # Receive some stuff. See also: More on Using Bash's Built-in /dev/tcp File (TCP/IP). answered Feb 11 '16 at 12:21 kenorbkenorb125k68 gold badges605 silver badges641 bronze badges Of course: curl curl Port 80 and 443 are just default port numbers. answered Dec 6 '13 at 22:30 user2926055user29260551, 8029 silver badges10 bronze badges Since you're using PHP, you will probably need to use the CURLOPT_PORT option, like so: curl_setopt($ch, CURLOPT_PORT, 11740); Bear in mind, you may face problems with SELinux: Unable to make php curl request with port number answered Dec 7 '13 at 1:33 brandonscriptbrandonscript59. 4k29 gold badges145 silver badges206 bronze badges Not the answer you're looking for? Browse other questions tagged php curl or ask your own question. How to specify a port with curl? - UNIX and Linux Forums

How to specify a port with curl? – UNIX and Linux Forums

9 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Bash script, find the next closed (not in use) port from some port range.
hi,
i would like to create a bash script that check which port in my Linux server are closed (not in use) from a specific range, port range (3000-3010).
the print output need to be only 1 port, and it will be nice if the output will be saved as a variable or in same file.
my code is:… (2 Replies)
Discussion started by: yossi
2. Shell Programming and Scripting
Help Generate new port base on the last port but not in used by other application
Hi Expert,
Anybody can figure it out on how to generate new port base on my last port let say my last port var1=124 and increment for new port 125, 126 but this new two ports need to look at first if this port is not in used by any service, if the port is in used add 1 to new port and if in used… (6 Replies)
Discussion started by: lxdorney
3. Solaris
How to find port number wwn of particular port on dual port HBA,?
please find the below o/p for your reference
bash-3. 00# fcinfo hba-port
HBA Port WWN: 21000024ff295a34
OS Device Name: /dev/cfg/c2
Manufacturer: QLogic Corp.
Model: 375-3356-02
Firmware Version: 05. 03. 02
FCode/BIOS Version: BIOS: 2. 02; fcode: 2. 01;… (3 Replies)
Discussion started by: sb200
5. IP Networking
Tcp ip port open but no such process (merged: Release A Port)
i want to kill a tcp connection by killing its pid
with netstat -an i got the tcp ip connection on port 5914
but when i type ps -a or ps-e there is not such process running on port 5914
is it possible that because i do not log on with proper user account i can not see that process running? (30 Replies)
Discussion started by: alinamadchian
6. IP Networking
telnet for port 5433 is not working while it works for port 22
Hi,
I am trying to set up a dev environment and I have Ubuntu server (10. 16. 1. 92) and a CentOS VM (10. 3. 235) on this. On the CentOS I have a program running on port 5433. Now my problem is that I am unable to telnet this port from another Windows server whereas I can telnet port 22 from… (5 Replies)
Discussion started by: rishav
7. Solaris
How to enable Serial port on ILOM, when Network Port is enabled in parallel
Hi Everyone,
In my environment, I have few T5220. On the iLOM Management Card, I have both Network and Serial port are cabled, I don’t have any issues while I try to connect using Network Management port, but when I try to connect the serial port for the same server which is actually connected… (3 Replies)
Discussion started by: bobby320
8. IP Networking
SSH Port Forwarding – sharing the same port
Hi Linux/Unix Guru,
I am setting Linux Hopping Station to another different servers.
My current config to connect to another servers is using different port to connect.
e. g
ssh -D 1080 -p 22
ssh -D 1081 -p 22
Now what I would like to have… (3 Replies)
Discussion started by: regmaster
9. Solaris
luxadm -e port shows one port not connected
hi i have a sun machine which has one hba 2ports;
out of which one port says it is not connected
# luxadm -e port
/devices/pci@1d, 700000/SUNW, qlc@1/fp@0, 0:devctl CONNECTED
/devices/pci@1d, 700000/SUNW, qlc@1, 1/fp@0, 0:devctl NOT CONNECTED
but both… (9 Replies)
Discussion started by: anwesh
How to specify the SSL port with command line curl? - Server ...

How to specify the SSL port with command line curl? – Server …

I’m trying to test the SSL connection on one of my servers. The server is behind a load balancer (LB) so it’s listening for SSL connections on the port 8090.
I have use the –resolve option to test when talking to the LB which listens on port 443.
curl –resolve ” ”
but when I do:
curl simply ignores the port and goes with 443. Of-course, this causes the DNS cache to miss and I end-up using the public DNS IP…
* Added to DNS cache
* About to connect() to port 443 (#0)
* Trying 3. 3. 3…
* Connected to (3. 3) port 443 (#0)
How can I force curl to use the port 8090 for an SSL connection?
Thanks.
asked Oct 1 ’13 at 0:50
4
Tested with curl 7. 22. 0 (x86_64-pc-linux-gnu) libcurl/7. 0 OpenSSL/1. 0. 1 zlib/1. 2. 4 libidn/1. 23 librtmp/2. 3, the –resolve header works as expected with and a non-standard port specified in both places.
answered Oct 2 ’13 at 0:22
Michael – sqlbotMichael – sqlbot21. 1k1 gold badge55 silver badges79 bronze badges
If –resolve is not working out, you can specify the Host header (you might need to supress certificate warnings with -k):
curl -k -H ‘Host: ‘ ”
or with more verbose terms:
curl –insecure –header ‘Host: ‘ ”
answered Oct 1 ’13 at 23:09
Not the answer you’re looking for? Browse other questions tagged ssl port curl or ask your own question.

Frequently Asked Questions about curl specify port

What port does curl use?

Such connections implicitly start out using SSL/TLS and as such servers and clients use TCP port 465 to communicate with each other.

What is the default curl port?

Port 80 and 443 are just default port numbers.Dec 7, 2013

Does curl use port 443?

curl simply ignores the port and goes with 443.Oct 1, 2013

Leave a Reply

Your email address will not be published. Required fields are marked *