InfoHeap
Tech tutorials, tips, tools and more
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 use ssh port forwarding to surf a site from different location
  2. Find which process is listening on a port on Linux
  3. Debug javascript using node-inspector, node-debug, nodemon and Chrome
  4. Python selenium – print browser log (including javascript errors) with phantomjs
  5. Use netcat (nc) to listen on tcp or udp port
  6. how to use netcat (nc) to test HTTP url redirection
  7. Use netcat (nc) to check if a remote port is reachable
  8. How to display a div in browser window center
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Linux, Networking, Tutorials, Unix

Follow InfoHeap

facebook
twitter
  • Browse site
  • Article Topics
  • Article archives
  • Recent Articles
  • Contact Us
  • Omoney
Popular Topics: AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | 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

Copyright © 2021 InfoHeap.

Powered by WordPress