DevBase is a versatile and multi-purpose library designed primarily for use with the OpenLyricsClient. The library features a collection of API endpoint implementations for popular services like Deezer, OpenAI, OpenLyricsClient, Replicate, and Tidal. In addition, DevBase offers various utilities, such as color calculation for images, cryptographic implementations, and parsers for various file formats.
- DevBase.Api
- DevBase.Avalonia
- DevBase.Cryptography and DevBase.Cryptography.BouncyCastle
- DevBase.Format
- DevBase.Logging
DevBase.Api contains API endpoint implementations for Deezer, OpenAI, OpenLyricsClient, Replicate, and Tidal. The library provides partial implementations that are tailored to meet the needs of the current project.
DevBase.Avalonia features a color calculator for images. The calculator helps determine dominant and accent colors within an image, making it easier to create visually appealing and harmonious designs.
The DevBase.Cryptography and DevBase.Cryptography.BouncyCastle libraries offer a collection of cryptographic implementations for various use cases. They provide a wide range of cryptographic algorithms and tools, including encryption, decryption, hashing, and digital signatures.
DevBase.Format contains parsers for the following file formats:
- .env: Environment files used to store configuration variables for applications, typically key-value pairs.
- .lrc: Lyric files used to store song lyrics and timestamps, allowing for synchronization between lyrics and audio playback.
- .srt: SubRip Text files used to store subtitles and their associated timestamps for video playback.
DevBase.Logging is a lightweight logger that makes it easy to log and debug your application. It offers a simple interface for logging messages, errors, and other information at various levels of granularity.
DevBase.Net is a high-performance HTTP client library featuring:
- Builder pattern for fluent request construction
- Memory<>/Span<> optimizations for performance
- SOCKS5 proxy support with HTTP tunnel capability
- Connection pooling and HTTP/3 support
- Retry policies with exponential backoff
- Request/Response interceptors
The HttpToSocks5Proxy component allows using SOCKS5 proxies with any HTTP client that supports IWebProxy. It creates a local HTTP proxy server that tunnels traffic through SOCKS5.
using DevBase.Net.Proxy.HttpToSocks5;
// Simple usage
var proxy = new HttpToSocks5Proxy("socks-server.com", 1080);
// With authentication
var proxy = new HttpToSocks5Proxy("socks-server.com", 1080, "username", "password");
// Chain multiple proxies
var proxy = new HttpToSocks5Proxy(new[] {
new Socks5ProxyInfo("first-proxy.com", 1080),
new Socks5ProxyInfo("second-proxy.com", 1090)
});
// Use with HttpClient
var handler = new HttpClientHandler { Proxy = proxy };
var client = new HttpClient(handler);The HttpToSocks5Proxy implementation is based on MihaZupan's HttpToSocks5Proxy library.
Original Author: Miha Zupan
License: MIT License
Copyright: © 2018 Miha Zupan
The original library has been integrated and optimized for performance with:
- Async/await patterns throughout
- ArrayPool for buffer management
- Span for string parsing
- Modern C# features and nullable reference types
We're excited to see DevBase grow and improve with the help of the community! If you'd like to contribute, we welcome your ideas, bug fixes, and enhancements. Join us in making DevBase even better, and let's build something amazing together!