Skip to content

Fix/20#21

Closed
6C656C65 wants to merge 4 commits into
mainfrom
fix/20
Closed

Fix/20#21
6C656C65 wants to merge 4 commits into
mainfrom
fix/20

Conversation

@6C656C65
Copy link
Copy Markdown
Member

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

What is the current behavior?

When calling server_socket.getpeername(), the code assumes the returned value is always a 2-element tuple (host, port).

However, with IPv6 connections, the method returns a 4-element tuple (host, port, flowinfo, scopeid), which causes unpacking errors such as:

ValueError: too many values to unpack (expected 2)

This breaks the application when handling IPv6 requests.

Issue Number: #20

What is the new behavior?

  • Properly handles both IPv4 and IPv6 tuple formats returned by getpeername()
  • Extracts only host and port in a safe and version-agnostic way
  • Adds test coverage to reproduce the issue and validate the fix
  • Ensures compatibility regardless of the underlying IP protocol used by the client

Other information

- Replace INI config with YAML format
- Embed all config data (blocked sites, URLs, shortcuts, headers, IPs) directly in YAML
- Remove separate .txt and .json config files
- Update code to use embedded config data
- Clean up unused imports and old code
- Update tests for new config structure
@6C656C65 6C656C65 self-assigned this Apr 30, 2026
@6C656C65 6C656C65 closed this Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant