GithubHelp home page GithubHelp logo

jgrahamc / httpdiff Goto Github PK

View Code? Open in Web Editor NEW
2.0K 42.0 70.0 193 KB

Perform the same request against two HTTP servers and diff the results

License: GNU General Public License v2.0

Makefile 1.85% Go 98.15%

httpdiff's Introduction

httpdiff

Perform the same request against two HTTP servers and diff the results. For best results use in a terminal that supports ANSI escape sequences.

Installation

go get github.com/jgrahamc/httpdiff
go install github.com/jgrahamc/httpdiff

Usage

Simple usage is to give it two URLs to fetch and it will diff the results. If the bodies are different they are saved to temporary files.

httpdiff http://www.google.co.uk http://www.google.com/

It's also possible to set the Host header to something other than what's in the URIs. This is sometimes useful when testing a temporary set up or when moving servers.

httpdiff -host example.com http://example.old.com/ http://example.new.com

Specific headers can be ignored with the -ignore option

httpdiff -ignore Set-Cookie,Date http://x.com http://y.com

The default HTTP method is GET but that can be changed

httpdiff -method HEAD http://example.com http://example2.com

Output example on Hacker News showing that Date changes each time

HN

Output example on Google showing difference between HTTP and HTTPS

HN

httpdiff's People

Contributors

agile6v avatar benjojo avatar bgentry avatar cdolan avatar ctrlrsf avatar divan avatar jgrahamc avatar sbl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

httpdiff's Issues

Tag a release?

Hello,

It’d be very helpful if you could tag a release so we know the code is stable and can be used. I work on Homebrew and we provide a way to install httpdiff but we rely on the git HEAD, so we can’t provide checksums and can’t ensure users will always get the same code depending on the time they install it, making it harder for us to debug issues.

Thanks!

Support custom for HTTP headers

I'd like to be be able to supply custom HTTP headers to both requests. I think something like the following would work:

$ httpdiff -header "X-Example: My value" -header "Host: example.com" https://domain.com https://domain.net

This would also allow you to consolidate some of the other methods like -host as it would be combined into the one option.

Usability issue - Unfortunate choice of colors

(I know this is a bug report, but I still would like to thank you for a great tool first and foremost!)

The choice of colors does not make it easy to distinguish them properly and efficiently.

A good bright yellow is not used though it is perfect on black and better than orange which can be confused with some shades of green.

Please consider clear contrast colors compared to perceived "prettiness".

Also structural queues can be better to spot quickly compared to colors, because of color vision deficiency (for example red green vision deficiency, not blindness as it's called sometimes) but also due to different personal usage / training.

This could be simple symbols such as + - > or short words, one letter words etc. Long wordy descriptions are no substitute because they cannot be recognized on the spot, but need a more careful look.

HTTP redirects fail to trigger a diff

While doing some CDN tests, I accidentally noticed that the client doesn't report status code or response differences for redirects:

$ httpdiff http://httpbin.org/status/301 http://httpbin.org/status/307
Doing GET: 
    http://httpbin.org/status/301
    http://httpbin.org/status/307 

This is presumably due to some magic in the Go http client for redirects since any other status code produces the expected output.

move code to root of repo

Drop the src directory and the makefile. They're not useful and just make the code more difficult to build (and are not idiomatic go). Once you do that, go get github.com/jgrahamc/httpdiff will Just Work™.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.