Skip to content

[Feature]: Add forced IPv4/IPv6 sessions with automatic adapter selection #19

@AHReccese

Description

@AHReccese

Describe the feature you want to add

Currently, users must manually create a Session, instantiate an adapter, and mount it on both http:// and https:// prefixes. This is repetitive boilerplate and requires users to know which adapter variant is best for their runtime.

We need a high-level API that:

  • Provides ready-to-use Session subclasses that enforce IPv4 or IPv6
  • Automatically selects the best adapter for the current Python/urllib3 runtime
  • Supports context-manager (with) usage for clean lifecycle management

Describe your proposed solution

Usage:

from ipforce import IPv4ForcedSession

with IPv4ForcedSession() as session:
    response = session.get('https://example.com')

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions