Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
planckscnst
on Nov 9, 2012
|
parent
|
context
|
favorite
| on:
Uses for cURL
'nc localhost 80' FTFY
fafner
on Nov 9, 2012
|
next
[–]
exec 5<>"/dev/tcp/localhost/80" echo -ne "GET / HTTP/1.1\r\nHost: localhost\r\n\r\n" > &5 cat < &5
FTFY
planckscnst
on Nov 9, 2012
|
parent
|
next
[–]
/dev/tcp is a bashism. It's not a real (kernel-provided) device.
jlgreco
on Nov 9, 2012
|
parent
|
prev
|
next
[–]
Clever, though nc really is better than telnet. It is much easier to pipe into just for starters.
tedunangst
on Nov 10, 2012
|
prev
[–]
Actually, you broke it. telnet sends CRLF line breaks like you're supposed to. nc will just send LF. A strict web server won't talk to you.
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: