InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Networking tutorials

  • DIG quick start tutorial
  • Dig - list all dns records
  • How to view wifi connection speed on Mac
  • Linux iptables - Nat port forwarding using PREROUTING
  • Linux iptables and ip6tables examples
  • Ngrep - quick start guide
  • Use nc to check if a remote port is reachable
  • Use nc to listen to tcp or udp port
  • Use nc to test HTTP url redirection
  • add more DNS servers to Wi-Fi interface on Mac
  • locally override website host to IP mapping
  • use nc to print headers from browser
 
  • Home
  • > Tutorials
  • > Networking

How to use nc (netcat) to print headers sent by a browser

By admin | Last updated on Mar 18, 2016

Unix utility nc (netcat) is a pretty handy utility for many network tasks. One such use is to see what headers are being sent by a browser to the server. Here are the steps:

  1. First run nc in server listening mode on a specific port. Use the command:
    nc -l 8080
    This will immediate create a quick server listening on port 8080. You can use some other port also. In case you want to use 80 which is default web server port then you will need to run this command as root.
    sudo nc -l 80
    For the purpose of this post we will use 8080.
  2. Assuming you have a domain name which is mapped to the ip address of this machine you can try to access that domain on port 8080 in browser (chrome, firefox or internet explorer). Or use the ip address of the machine where you are running nc e.g. http://192.168.100.103:8080/
    nc-netcat-browser-8080
  3. Here is the outcome for chrome:
    nc netcat chrome headers

This can be pretty handy at times when you don’t have any easy way to view headers sent by the browser or any other client process.

Suggested posts:

  1. How to monitor 404 pages on your site
  2. Use x2go to access remote Ubuntu Linux
  3. HTML form file upload hello world
  4. CSS – enlarge image on hover
  5. Bash – how to find last command exit status code
  6. How to prevent ssh session freezing due to timeout
  7. How to add more DNS servers to Wi-Fi interface on Mac
  8. How to find recursion stack growth direction using C code
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Linux, Networking, Tutorials, Unix
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress