Coder Social home page Coder Social logo

hushagent's Introduction

hushagent

WIP

As information is becoming more and more valuable, it's important to protect it. This is a simple technique that will mask the destination of your requests.

To illustrate, let's say you're using a proxy to make requests to httpbin.org, www.wikipedia.org, and www.cloudflare.com.

Instead of your proxy provider seeing:

1701633972.803   1003 $SERVER_IP TCP_TUNNEL/200 6186 CONNECT httpbin.org:443 $USER HIER_DIRECT/54.83.155.149 -
1701633973.092    211 $SERVER_IP TCP_TUNNEL/200 28332 CONNECT www.wikipedia.org:443 $USER HIER_DIRECT/208.80.154.224 -
1701633973.346    161 $SERVER_IP TCP_TUNNEL/200 71077 CONNECT www.cloudflare.com:443 $USER HIER_DIRECT/104.16.124.96 -

Why not have them see this instead:

1701633974.303    817 $SERVER_IP TCP_TUNNEL/200 6215 CONNECT 75.101.131.185:443 $USER HIER_DIRECT/75.101.131.185 -
1701633975.058    490 $SERVER_IP TCP_TUNNEL/200 28331 CONNECT 208.80.154.224:443 $USER HIER_DIRECT/208.80.154.224 -
1701633975.849    284 $SERVER_IP TCP_TUNNEL/200 71134 CONNECT 104.16.124.96:443 $USER HIER_DIRECT/104.16.124.96 -

Usage

import { hush } from "@rpappa/hushagent";

const hushedAgent = hush(YOUR_AGENT_HERE);

Performance

 BENCH  Summary

  without hush - test/index.bench.ts > requests to localhost
    1.09x faster than with hush

  without hush - test/index.bench.ts > requests to httpbin with proxy
    1.05x faster than with hush

Likely some improvements to be made, haven't tested "in the real world"

Limitations

The assumed threat model for this is you have a malicious proxy provider. If you have a malicious proxy provider that is trying to figure out what you might be doing, this will help mask the destination of your requests.

However, if you easily determine the destination of your request based on the IP address, this will not help you. For example, if you are directly hitting origin servers, or if reverse DNS is possible. But, if the domain name resolves to a large CDN, this may provide some protection.

hushagent's People

Contributors

rpappa avatar

Watchers

 avatar  avatar

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.