Skip to content

JeninSutradhar/fortifynet_proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FortifyNet Proxy: Secure and Efficient Rust Proxy Server

FortifyNet Proxy is a lightweight Rust proxy server designed to provide secure and efficient handling of HTTP requests with basic authentication and resource caching capabilities.

Features

  1. Proxy Authentication: Securely authenticate users before allowing access to resources.
  2. HTTP Request Handling: Efficiently handle HTTP requests and generate appropriate responses.
  3. Activity Logging: Log proxy server activities for monitoring and troubleshooting.
  4. Resource Caching: Cache frequently accessed resources to optimize performance.
  5. Graceful Shutdown: Gracefully shutdown the proxy server to ensure data integrity and user experience.

Installation

To use FortifyNet Proxy in your Rust project, add the following line to your Cargo.toml file:

[dependencies]
fortifynet_proxy = "1.1.7"

Usage

Basic Usage

To use the FortifyNet Proxy Server, follow these simple steps:

  • Define a ProxyConfig struct to specify the server configuration parameters.
  • Start the proxy server using the start_proxy_server function with the provided configuration.
use fortifynet_proxy::{ProxyConfig, start_proxy_server};

fn main() {
    // Define proxy server configuration
    let config = ProxyConfig {
        ip_address: "127.0.0.1".to_string(),
        port: 8080,
        authentication: true,
        username: "admin".to_string(),
        password: "password123".to_string(),
        cache_enabled: true,
    };

    // Start the proxy server with the provided configuration
    start_proxy_server(config);
}

Customization:

FortifyNet Proxy offers extensive configuration options:

  • IP Address and Port: Specify the desired IP address and port for the server.
  • Authentication: Enable user authentication with custom usernames and passwords.
  • Resource Caching: Implement caching strategies to store frequently accessed resources and improve performance.

Advanced Usage

Customized Authentication

Configure custom authentication settings to enforce user access control.

use fortifynet_proxy::{ProxyConfig, start_proxy_server};

fn main() {
    // Configure custom authentication
    let config = ProxyConfig {
        ip_address: "127.0.0.1".to_string(),
        port: 8080,
        authentication: true,
        username: "admin".to_string(),
        password: "password123".to_string(),
        cache_enabled: true,
    };

    // Start the proxy server with custom authentication
    start_proxy_server(config);
}

Resource Caching Strategies

Implement resource caching strategies to optimize network performance.

use fortifynet_proxy::{ProxyConfig, start_proxy_server};

fn main() {
    // Configure resource caching
    let config = ProxyConfig {
        ip_address: "127.0.0.1".to_string(),
        port: 8080,
        authentication: false,
        username: "".to_string(),
        password: "".to_string(),
        cache_enabled: true,
    };

    // Start the proxy server with resource caching enabled
    start_proxy_server(config);
}

Graceful Shutdown Handling

Gracefully shutdown the proxy server to ensure ongoing connections are completed.

use fortifynet_proxy::{ProxyConfig, start_proxy_server};

fn main() {
    // Configure proxy server
    let config = ProxyConfig {
        ip_address: "127.0.0.1".to_string(),
        port: 8080,
        authentication: false,
        username: "".to_string(),
        password: "".to_string(),
        cache_enabled: true,
    };

    // Start the proxy server
    let server_thread = start_proxy_server(config);

    // Gracefully shutdown the server after a specified time
    std::thread::sleep(std::time::Duration::from_secs(10));
    server_thread.join().expect("Failed to join server thread");
}

Further Resources:

Project Crate: https://crates.io/crates/fortifynet_proxy

About

FortifyNet Proxy is a lightweight Rust proxy server designed to provide secure and efficient handling of HTTP requests with basic authentication and resource caching capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages