
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
github.com/greysquirr3l/lashes
A high-performance, thread-safe proxy rotation library for Go applications with zero core dependencies. Supports multiple proxy types, configurable rotation strategies, and optional persistence layers.
go get github.com/greysquirr3l/lashes
package main
import (
"context"
"log"
"net/http"
"github.com/greysquirr3l/lashes"
)
func main() {
// Create a new rotator with default options
rotator, err := lashes.New(lashes.DefaultOptions())
if err != nil {
log.Fatalf("Failed to create rotator: %v", err)
}
// Add some proxies
ctx := context.Background()
rotator.AddProxy(ctx, "http://proxy1.example.com:8080", lashes.HTTP)
rotator.AddProxy(ctx, "http://proxy2.example.com:8080", lashes.HTTP)
rotator.AddProxy(ctx, "socks5://proxy3.example.com:1080", lashes.SOCKS5)
// Get an HTTP client using the next proxy in rotation
client, err := rotator.Client(ctx)
if err != nil {
log.Fatalf("Failed to get client: %v", err)
}
// Make a request
resp, err := client.Get("https://api.ipify.org?format=json")
if err != nil {
log.Fatalf("Request failed: %v", err)
}
defer resp.Body.Close()
// Process the response...
}
import (
"github.com/greysquirr3l/lashes"
"github.com/greysquirr3l/lashes/internal/storage"
)
opts := lashes.Options{
Storage: &storage.Options{
Type: lashes.SQLite,
FilePath: "proxies.db",
QueryTimeout: 5 * time.Second,
},
Strategy: lashes.WeightedStrategy,
}
rotator, err := lashes.New(opts)
Each strategy is optimized for different use cases:
// Round-robin (default)
opts := lashes.DefaultOptions()
// Random selection
opts := lashes.Options{
Strategy: lashes.RandomStrategy,
}
// Weighted distribution
opts := lashes.Options{
Strategy: lashes.WeightedStrategy,
}
// Least used
opts := lashes.Options{
Strategy: lashes.LeastUsedStrategy,
}
breakerConfig := lashes.DefaultCircuitBreakerConfig()
breakerConfig.MaxFailures = 3
breakerConfig.ResetTimeout = 30 * time.Second
circuitBreaker := rotator.EnableCircuitBreaker(breakerConfig)
healthOpts := lashes.DefaultHealthCheckOptions()
healthOpts.Interval = 5 * time.Minute
healthOpts.Parallel = 5 // Check 5 proxies concurrently
ctx := context.Background()
rotator.StartHealthCheck(ctx, healthOpts)
// Limit to 10 requests per second with burst of 30
rateLimiter := rotator.UseRateLimit(10, 30)
proxy, err := rotator.GetProxy(ctx)
if err != nil {
switch {
case errors.Is(err, lashes.ErrNoProxiesAvailable):
// Handle missing proxy
case errors.Is(err, lashes.ErrProxyNotFound):
// Handle proxy not found
case errors.Is(err, lashes.ErrValidationFailed):
// Handle validation failure
default:
// Handle unknown error
}
}
// Get metrics for all proxies
metrics, err := rotator.GetAllMetrics(ctx)
if err != nil {
log.Fatalf("Failed to get metrics: %v", err)
}
// Display metrics
for _, m := range metrics {
fmt.Printf("Proxy: %s, Success: %.1f%%, Requests: %d, Avg Latency: %v\n",
m.URL,
m.SuccessRate * 100,
m.TotalCalls,
time.Duration(m.AvgLatency))
}
crypto/rand
rate.Limiter
We welcome contributions! Please see our Contributing Guide for details.
# Clone repository
git clone https://github.com/greysquirr3l/lashes.git
cd lashes
# Install dependencies
go mod download
# Run tests
go test -v ./...
Core:
Optional:
MIT © The Author and Contributors
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.