Giter VIP home page Giter VIP logo

proxyboi's Introduction

Hi there, random stranger! ๐Ÿ‘‹

Stay awhile and listen

  • I make handy CLI tools. ๐Ÿ”ง
  • I quite like Rust. ๐Ÿฆ€
  • I do graphics and high-performance stuff. ๐ŸŽ๏ธ
  • I like automation and when things just maintain themselves. Sadly though, they rarely do in practice. ๐Ÿค–
  • I am a developer and devops in Arch Linux where I also maintain a ton of packages! ๐Ÿง

Also check out svenstaro.org.

If you like my work, please consider supporting me!

proxyboi's People

Contributors

asaaki avatar dependabot-preview[bot] avatar dependabot[bot] avatar holgzn avatar svenstaro 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

proxyboi's Issues

ARM64 Support, on Docker

The proxy binaries are currently built (also) for Linux arm and arm64. However the docker hub container is only released for x86-64.

It would be nice to have the ๐Ÿณ containers also released for arm64 (which would allow running the proxy, dockerized, on Raspberry PI for example).

Potential suggestion solution: using docker manifests. However i did not find how is the current image built & published to the hub registry.

Current version published on crates.io fails to compile

> cargo install proxyboi
error[E0432]: unresolved import `clap::Clap`
 --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:2:5
  |
2 | use clap::Clap;
  |     ^^^^^^^^^^ no `Clap` in the root

error[E0432]: unresolved import `clap::Clap`
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/main.rs:13:5
   |
13 | use clap::Clap;
   |     ^^^^^^^^^^ no `Clap` in the root

error: cannot determine resolution for the derive macro `Clap`
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:28:10
   |
28 | #[derive(Clap, Debug, Clone)]
   |          ^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:29:3
   |
29 | #[clap(
   |   ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:38:7
   |
38 |     #[clap(short, long, default_value = "0.0.0.0:8080")]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:42:7
   |
42 |     #[clap(short = 'k', long)]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:46:7
   |
46 |     #[clap(short, long)]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:50:7
   |
50 |     #[clap(short, long)]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:54:7
   |
54 |     #[clap()]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:58:7
   |
58 |     #[clap(long = "upstream-header", parse(try_from_str = parse_header))]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:62:7
   |
62 |     #[clap(long = "response-header", parse(try_from_str = parse_header))]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:66:7
   |
66 |     #[clap(long, default_value = "5")]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:70:7
   |
70 |     #[clap(long = "cert", requires = "tls-key")]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:74:7
   |
74 |     #[clap(long = "key", requires = "tls-cert")]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error[E0599]: no function or associated item named `parse` found for struct `ProxyboiConfig` in the current scope
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/main.rs:46:34
   |
46 |     let config = ProxyboiConfig::parse();
   |                                  ^^^^^ function or associated item not found in `ProxyboiConfig`
   |
  ::: .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/config.rs:36:1
   |
36 | pub struct ProxyboiConfig {
   | ------------------------- function or associated item `parse` not found for this
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following traits define an item `parse`, perhaps you need to implement one of them:
           candidate #1: `actix_web::http::header::Header`
           candidate #2: `time::private::Parsable`
           candidate #3: `Parser`

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/main.rs:90:18
   |
90 |     if let (Some(tls_cert), Some(tls_key)) = (config_.tls_cert, config_.tls_key) {
   |                  ^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]`
   = note: required because it appears within the type `std::path::Path`
   = note: all local variables must have a statically known size
   = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/proxyboi-0.5.0/src/main.rs:90:34
   |
90 |     if let (Some(tls_cert), Some(tls_key)) = (config_.tls_cert, config_.tls_key) {
   |                                  ^^^^^^^ doesn't have a size known at compile-time
   |
   = help: within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]`
   = note: required because it appears within the type `std::path::Path`
   = note: all local variables must have a statically known size
   = help: unsized locals are gated as an unstable feature

Some errors have detailed explanations: E0277, E0432, E0599.

Add --request-header

It would be so nice to add request headers (e.g. Authorization) to the upstream with a --request-header parameter similar to --response-header. ๐Ÿ‘

Specify payload size limit

Hello. I discovered proxyboi recently, and I find it really convenient for testing and whatnot. My issue is that when sending really large packets, the proxy doesn't forward the request to the upstream and instead just returns A payload reached size limit.
If the request is under limit, but the response is too big, then I get the following error:

13:48:28 [ERROR] Unknown Internal Error
13:48:28 [ERROR] Internal Server Error: PayloadError(Overflow)

I think it would be beneficial to add options for changing the limits on the sizes of requests and responses.

Can't proxy to a server presenting a certificate with an IP address in its common name

If I try to proxy to a local ip with an https server running, e.g. https://1.2.3.4, proxyboi crashes with the following message:

thread 'actix-rt:worker:0' panicked at 'rustls currently only handles hostname-based connections. See https://github.com/briansmith/webpki/issues/54: InvalidDNSNameError', /cargo/registry/src/github.com-1ecc6299db9ec823/actix-connect-2.0.0/src/ssl/rustls.rs:107:14

For what it's worth, rustls forked the webpki repo and is including the fix in the upcoming 0.21.0 release (rustls/rustls#184) -- so you might want to rebuild with that soon

export as lib

would be great to be able to use this as a lib in another program

Don't set x-forwarded-for by default?

Given that one can manually add additional headers via the --upstream-header option, I think it'd be reasonable to avoid setting the forwarded-for header by default. I.e. the assumption is the proxy should resend the request from the client exactly, just replacing the Host header.

No way to specify a timeout

If the server takes longer than 5 seconds to respond to a request the proxy times out. It would be useful to be able to increase this timeout.

Release for linux-x86_64 fails to execute

> curl -O https://github.com/svenstaro/proxyboi/releases/download/v0.5.0/proxyboi-v0.5.0-linux-x86_64
> chmod +x ./proxyboi-v0.5.0-linux-x86_64
> ./proxyboi-v0.5.0-linux-x86_64
Failed to execute process './proxyboi-v0.5.0-linux-x86_64'. Reason:
exec: Exec format error
The file './proxyboi-v0.5.0-linux-x86_64' is marked as an executable but could not be run by the operating system.

I cloned the repo and built a release build via cargo build --release and that one runs perfectly:

> ./target/release/proxyboi
error: The following required arguments were not provided:
    <upstream>

USAGE:
    proxyboi <upstream> --listen <listen> --timeout <timeout>

For more information try --help

# uname -a
Linux minirack 5.4.0-74-generic #83-Ubuntu SMP Sat May 8 02:35:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

# rustc --version
rustc 1.51.0 (2fd73fabe 2021-03-23)

# cargo --version
cargo 1.51.0 (43b129a20 2021-03-16)

Error message: Address not available

I built the docker image and then wanted to start it through this command:

docker run proxyboi -l ip:4430 http://ip:8501
and then got this error:
Error: Os { code: 99, kind: AddrNotAvailable, message: "Address not available" }

For "ip" i wrote the ip adress of my server where actually an http application is running on port 8501. I would like to listen to port 4430 (tls) and this should be forwarded to port 8501 and give the content from this application back. With ssl -proxy in the windows console it worked.

Could it be, that this implementation does not support ip adresses but only domain names?

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.