httpcore2 2.4.0__tar.gz → 2.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {httpcore2-2.4.0 → httpcore2-2.5.0}/CHANGELOG.md +6 -0
  2. {httpcore2-2.4.0 → httpcore2-2.5.0}/PKG-INFO +7 -1
  3. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_async/socks_proxy.py +11 -6
  4. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_sync/socks_proxy.py +11 -6
  5. {httpcore2-2.4.0 → httpcore2-2.5.0}/.gitignore +0 -0
  6. {httpcore2-2.4.0 → httpcore2-2.5.0}/LICENSE.md +0 -0
  7. {httpcore2-2.4.0 → httpcore2-2.5.0}/README.md +0 -0
  8. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/__init__.py +0 -0
  9. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_api.py +0 -0
  10. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_async/__init__.py +0 -0
  11. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_async/connection.py +0 -0
  12. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_async/connection_pool.py +0 -0
  13. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_async/http11.py +0 -0
  14. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_async/http2.py +0 -0
  15. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_async/http_proxy.py +0 -0
  16. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_async/interfaces.py +0 -0
  17. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_backends/__init__.py +0 -0
  18. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_backends/anyio.py +0 -0
  19. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_backends/auto.py +0 -0
  20. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_backends/base.py +0 -0
  21. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_backends/mock.py +0 -0
  22. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_backends/sync.py +0 -0
  23. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_backends/trio.py +0 -0
  24. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_exceptions.py +0 -0
  25. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_models.py +0 -0
  26. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_ssl.py +0 -0
  27. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_sync/__init__.py +0 -0
  28. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_sync/connection.py +0 -0
  29. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_sync/connection_pool.py +0 -0
  30. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_sync/http11.py +0 -0
  31. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_sync/http2.py +0 -0
  32. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_sync/http_proxy.py +0 -0
  33. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_sync/interfaces.py +0 -0
  34. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_synchronization.py +0 -0
  35. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_trace.py +0 -0
  36. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/_utils.py +0 -0
  37. {httpcore2-2.4.0 → httpcore2-2.5.0}/httpcore2/py.typed +0 -0
  38. {httpcore2-2.4.0 → httpcore2-2.5.0}/pyproject.toml +0 -0
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
 
7
+ ## 2.5.0 (June 25th, 2026)
8
+
9
+ ### Fixed
10
+
11
+ * Propagate the timeout through the SOCKS5 handshake. ([#1009](https://github.com/pydantic/httpx2/pull/1009))
12
+
7
13
  ## 2.4.0 (June 11th, 2026)
8
14
 
9
15
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: httpcore2
3
- Version: 2.4.0
3
+ Version: 2.5.0
4
4
  Summary: A minimal low-level HTTP client.
5
5
  Project-URL: Changelog, https://github.com/pydantic/httpx2/blob/main/src/httpcore2/CHANGELOG.md
6
6
  Project-URL: Homepage, https://github.com/pydantic/httpx2
@@ -151,6 +151,12 @@ All notable changes to this project will be documented in this file.
151
151
 
152
152
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
153
153
 
154
+ ## 2.5.0 (June 25th, 2026)
155
+
156
+ ### Fixed
157
+
158
+ * Propagate the timeout through the SOCKS5 handshake. ([#1009](https://github.com/pydantic/httpx2/pull/1009))
159
+
154
160
  ## 2.4.0 (June 11th, 2026)
155
161
 
156
162
  ### Fixed
@@ -45,7 +45,11 @@ async def _init_socks5_connection(
45
45
  host: bytes,
46
46
  port: int,
47
47
  auth: tuple[bytes, bytes] | None = None,
48
+ timeouts: dict[str, float | None] | None = None,
48
49
  ) -> None:
50
+ timeouts = timeouts or {}
51
+ write_timeout = timeouts.get("write", None)
52
+ read_timeout = timeouts.get("read", None)
49
53
  conn = socksio.socks5.SOCKS5Connection()
50
54
 
51
55
  # Auth method request
@@ -56,10 +60,10 @@ async def _init_socks5_connection(
56
60
  )
57
61
  conn.send(socksio.socks5.SOCKS5AuthMethodsRequest([auth_method]))
58
62
  outgoing_bytes = conn.data_to_send()
59
- await stream.write(outgoing_bytes)
63
+ await stream.write(outgoing_bytes, timeout=write_timeout)
60
64
 
61
65
  # Auth method response
62
- incoming_bytes = await stream.read(max_bytes=4096)
66
+ incoming_bytes = await stream.read(max_bytes=4096, timeout=read_timeout)
63
67
  response = conn.receive_data(incoming_bytes)
64
68
  assert isinstance(response, socksio.socks5.SOCKS5AuthReply)
65
69
  if response.method != auth_method:
@@ -73,10 +77,10 @@ async def _init_socks5_connection(
73
77
  username, password = auth
74
78
  conn.send(socksio.socks5.SOCKS5UsernamePasswordRequest(username, password))
75
79
  outgoing_bytes = conn.data_to_send()
76
- await stream.write(outgoing_bytes)
80
+ await stream.write(outgoing_bytes, timeout=write_timeout)
77
81
 
78
82
  # Username/password response
79
- incoming_bytes = await stream.read(max_bytes=4096)
83
+ incoming_bytes = await stream.read(max_bytes=4096, timeout=read_timeout)
80
84
  response = conn.receive_data(incoming_bytes)
81
85
  assert isinstance(response, socksio.socks5.SOCKS5UsernamePasswordReply)
82
86
  if not response.success:
@@ -85,10 +89,10 @@ async def _init_socks5_connection(
85
89
  # Connect request
86
90
  conn.send(socksio.socks5.SOCKS5CommandRequest.from_address(socksio.socks5.SOCKS5Command.CONNECT, (host, port)))
87
91
  outgoing_bytes = conn.data_to_send()
88
- await stream.write(outgoing_bytes)
92
+ await stream.write(outgoing_bytes, timeout=write_timeout)
89
93
 
90
94
  # Connect response
91
- incoming_bytes = await stream.read(max_bytes=4096)
95
+ incoming_bytes = await stream.read(max_bytes=4096, timeout=read_timeout)
92
96
  response = conn.receive_data(incoming_bytes)
93
97
  assert isinstance(response, socksio.socks5.SOCKS5Reply)
94
98
  if response.reply_code != socksio.socks5.SOCKS5ReplyCode.SUCCEEDED:
@@ -229,6 +233,7 @@ class AsyncSocks5Connection(AsyncConnectionInterface):
229
233
  "host": self._remote_origin.host.decode("ascii"),
230
234
  "port": self._remote_origin.port,
231
235
  "auth": self._proxy_auth,
236
+ "timeouts": timeouts,
232
237
  }
233
238
  async with Trace("setup_socks5_connection", logger, request, kwargs) as trace:
234
239
  await _init_socks5_connection(**kwargs)
@@ -45,7 +45,11 @@ def _init_socks5_connection(
45
45
  host: bytes,
46
46
  port: int,
47
47
  auth: tuple[bytes, bytes] | None = None,
48
+ timeouts: dict[str, float | None] | None = None,
48
49
  ) -> None:
50
+ timeouts = timeouts or {}
51
+ write_timeout = timeouts.get("write", None)
52
+ read_timeout = timeouts.get("read", None)
49
53
  conn = socksio.socks5.SOCKS5Connection()
50
54
 
51
55
  # Auth method request
@@ -56,10 +60,10 @@ def _init_socks5_connection(
56
60
  )
57
61
  conn.send(socksio.socks5.SOCKS5AuthMethodsRequest([auth_method]))
58
62
  outgoing_bytes = conn.data_to_send()
59
- stream.write(outgoing_bytes)
63
+ stream.write(outgoing_bytes, timeout=write_timeout)
60
64
 
61
65
  # Auth method response
62
- incoming_bytes = stream.read(max_bytes=4096)
66
+ incoming_bytes = stream.read(max_bytes=4096, timeout=read_timeout)
63
67
  response = conn.receive_data(incoming_bytes)
64
68
  assert isinstance(response, socksio.socks5.SOCKS5AuthReply)
65
69
  if response.method != auth_method:
@@ -73,10 +77,10 @@ def _init_socks5_connection(
73
77
  username, password = auth
74
78
  conn.send(socksio.socks5.SOCKS5UsernamePasswordRequest(username, password))
75
79
  outgoing_bytes = conn.data_to_send()
76
- stream.write(outgoing_bytes)
80
+ stream.write(outgoing_bytes, timeout=write_timeout)
77
81
 
78
82
  # Username/password response
79
- incoming_bytes = stream.read(max_bytes=4096)
83
+ incoming_bytes = stream.read(max_bytes=4096, timeout=read_timeout)
80
84
  response = conn.receive_data(incoming_bytes)
81
85
  assert isinstance(response, socksio.socks5.SOCKS5UsernamePasswordReply)
82
86
  if not response.success:
@@ -85,10 +89,10 @@ def _init_socks5_connection(
85
89
  # Connect request
86
90
  conn.send(socksio.socks5.SOCKS5CommandRequest.from_address(socksio.socks5.SOCKS5Command.CONNECT, (host, port)))
87
91
  outgoing_bytes = conn.data_to_send()
88
- stream.write(outgoing_bytes)
92
+ stream.write(outgoing_bytes, timeout=write_timeout)
89
93
 
90
94
  # Connect response
91
- incoming_bytes = stream.read(max_bytes=4096)
95
+ incoming_bytes = stream.read(max_bytes=4096, timeout=read_timeout)
92
96
  response = conn.receive_data(incoming_bytes)
93
97
  assert isinstance(response, socksio.socks5.SOCKS5Reply)
94
98
  if response.reply_code != socksio.socks5.SOCKS5ReplyCode.SUCCEEDED:
@@ -229,6 +233,7 @@ class Socks5Connection(ConnectionInterface):
229
233
  "host": self._remote_origin.host.decode("ascii"),
230
234
  "port": self._remote_origin.port,
231
235
  "auth": self._proxy_auth,
236
+ "timeouts": timeouts,
232
237
  }
233
238
  with Trace("setup_socks5_connection", logger, request, kwargs) as trace:
234
239
  _init_socks5_connection(**kwargs)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes