Skip to content

Commit

Permalink
Tag v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeajimenezl committed Sep 14, 2023
1 parent 20cc189 commit 88f5ca9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "proxyswarm"
version = "0.3.7"
version = "0.4.0"
authors = ["Jorge Alejandro Jimenez Luna <jorgeajimenezl17@gmail.com>"]
edition = "2021"
description = "Proxyswarm is a tiny lightweight proxy that allows redirect HTTP(S) traffic through a proxy."
Expand Down
2 changes: 1 addition & 1 deletion build/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Jorge Alejandro Jimenez Luna <jorgeajimenezl17@gmail.com>

pkgname=proxyswarm
pkgver=0.3.7
pkgver=0.4.0
pkgrel=1
pkgdesc="Lightweight proxy that allows redirect HTTP(S) traffic through a proxy."
arch=('x86_64')
Expand Down
3 changes: 3 additions & 0 deletions src/transport/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,18 @@ impl HttpServer {
impl Server for HttpServer {
type StreamType = TcpStream;

#[inline]
async fn bind(addr: SocketAddr) -> std::io::Result<Box<Self>> {
let listener = TcpListener::bind(addr).await?;
Ok(Box::new(HttpServer { listener }))
}

#[inline]
async fn accept(&self) -> std::io::Result<(Self::StreamType, SocketAddr)> {
self.listener.accept().await
}

#[inline]
async fn handle_connection(
context: AppContext,
id: u32,
Expand Down
3 changes: 3 additions & 0 deletions src/transport/socks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,18 @@ impl SocksServer {
impl Server for SocksServer {
type StreamType = IncomingConnection<()>;

#[inline]
async fn bind(addr: SocketAddr) -> std::io::Result<Box<Self>> {
let server = Socks5Server::bind(addr, Arc::new(NoAuth)).await?;
Ok(Box::new(SocksServer { server }))
}

#[inline]
async fn accept(&self) -> std::io::Result<(Self::StreamType, SocketAddr)> {
self.server.accept().await
}

#[inline]
async fn handle_connection(
context: AppContext,
id: u32,
Expand Down

0 comments on commit 88f5ca9

Please sign in to comment.