Skip to content

Paranoidhttp provides a pre-configured http.Client that protects you from harm.

License

Notifications You must be signed in to change notification settings

Songmu/paranoidhttp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paranoidhttp

Build Status

Paranoidhttp provides a pre-configured http.Client that protects you from harm.

Description

Paranoidhttp is a factory of http.Client that is paranoid againt attackers. This is useful when you craete a HTTP request using inputs from possibly malicious users.

The created http.Client protects you from connecting to internal IP ranges even though redirects or DNS tricks are used.

Synopsis

// use the default client for ease
res, err := paranoidhttp.DefaultClient.Get("http://www.hatena.ne.jp")

// or customize the client for yourself
client, transport, dialer := paranoidhttp.NewClient()
client.Timeout = 10 * time.Second
transport.DisableCompression = true
dialer.KeepAlive = 60 * time.Second

Known Issues

  • Supports only IPv4 (blocks IPv6).

Acknowledgement

I want to thank LWPx::ParanoidAgent.

License

MIT

Author

hakobe

About

Paranoidhttp provides a pre-configured http.Client that protects you from harm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 96.9%
  • Makefile 3.1%