Commit Graph

56 Commits

Author SHA1 Message Date
cdbd80eeba Merge remote changes with local WebSocket improvements
- Combined yashksaini-coder's flow control improvements with luca's WSS features
- Preserved comprehensive WSS support, TLS configuration, and handshake timeout
- Added production-ready buffer management and connection limits
- Maintained backward compatibility with existing WebSocket functionality
- Integrated both approaches for optimal WebSocket transport implementation
2025-09-17 01:00:15 -04:00
4fdfdae9fb Refactor P2PWebSocketConnection and WebsocketTransport constructors for improved readability. Clean up whitespace and enhance logging for connection management. 2025-09-12 03:11:43 +05:30
0271a36316 Update the flow control, buffer management, and connection limits. Implement proper error handling and cleanup in P2PWebSocketConnection. Update tests for improved connection handling. 2025-09-12 03:04:38 +05:30
93db588b9e Merge branch 'main' into add-ws-transport 2025-09-10 02:49:52 +05:30
f4d5a44521 Fix type errors and linting issues
- Fix type annotation errors in transport_registry.py and __init__.py
- Fix line length violations in test files (E501 errors)
- Fix missing return type annotations
- Fix cryptography NameAttribute type errors with type: ignore
- Fix ExceptionGroup import for cross-version compatibility
- Fix test failure in test_wss_listen_without_tls_config by handling ExceptionGroup
- Fix len() calls with None arguments in test_tcp_data_transfer.py
- Fix missing attribute access errors on interface types
- Fix boolean type expectation errors in test_js_ws_ping.py
- Fix nursery context manager type errors

All tests now pass and linting is clean.
2025-09-08 04:18:10 +02:00
afe6da5db2 Merge upstream/main into add-ws-transport
Resolved conflicts in:
- .gitignore: Combined JavaScript interop and Sphinx build ignores
- libp2p/__init__.py: Integrated QUIC transport support with WebSocket transport
- libp2p/network/swarm.py: Used upstream's improved listener handling
- pyproject.toml: Kept both WebSocket and QUIC dependencies

This merge brings in:
- QUIC transport implementation
- Enhanced swarm functionality
- Improved peer discovery
- Better error handling
- Updated dependencies and documentation

WebSocket transport implementation remains intact and functional.
2025-09-07 23:47:41 +02:00
396812e84a Experimental: Add comprehensive WebSocket and WSS implementation with tests
- Implemented full WSS support with TLS configuration
- Added handshake timeout and connection state tracking
- Created comprehensive test suite with 13+ WSS unit tests
- Added Python-to-Python WebSocket peer-to-peer tests
- Implemented multiaddr parsing for /ws, /wss, /tls/ws formats
- Added connection state tracking and concurrent close handling
- Created standalone WebSocket client for testing
- Fixed circular import issues with multiaddr utilities
- Added debug tools for WebSocket URL testing

All WebSocket transport functionality is complete and working.
Tests demonstrate WebSocket transport works correctly at the transport layer.
Higher-level libp2p protocol compatibility issues remain (same as JS interop).
2025-09-07 23:44:17 +02:00
9749be6574 fix: refine selection of quic transport while init 2025-08-31 16:07:41 +00:00
e1141ee376 fix: fix nim interop env setup file 2025-08-31 06:47:15 +00:00
89cb8c0bd9 fix: check forced failure for nim interop 2025-08-30 14:08:53 +05:30
d97b86081b fix: add nim libp2p echo interop 2025-08-30 14:08:53 +05:30
fe4c17e8d1 Fix typecheck errors and improve WebSocket transport implementation
- Fix INotifee interface compliance in WebSocket demo
- Fix handler function signatures to be async (THandler compatibility)
- Fix is_closed method usage with proper type checking
- Fix pytest.raises multiple exception type issue
- Fix line length violations (E501) across multiple files
- Add debugging logging to Noise security module for troubleshooting
- Update WebSocket transport examples and tests
- Improve transport registry error handling
2025-08-11 01:25:49 +02:00
1997777c52 Fix IPv6 host bracketing in WebSocket transport 2025-07-23 08:10:51 +00:00
4fb7132b4e Prevent crash in JS interop test
Signed-off-by: GautamBytes <manchandanigautam@gmail.com>
2025-07-20 19:10:03 +00:00
227a5c6441 small tweak
Signed-off-by: GautamBytes <manchandanigautam@gmail.com>
2025-07-20 09:30:21 +00:00
187418378a added WebSocket transport support
Signed-off-by: GautamBytes <manchandanigautam@gmail.com>
2025-07-20 09:23:42 +00:00
4bbb08ce2d feat: add length-prefixed protobuf support to identify protocol 2025-07-13 16:13:52 +02:00
912669a924 doc: newsfragment 2025-07-13 16:04:46 +02:00
96434d9977 Remove .git 2025-07-10 23:59:26 +02:00
1507100632 Add interoperability test for py-libp2p and js-libp2p with enhanced logging 2025-07-10 23:59:26 +02:00
fd893afba6 delete old interop, turn on with placeholders, add py312 and py313 to CI testing 2025-05-08 13:30:00 -06:00
24b2704d8c move factories to tests/utils/factories 2025-03-27 14:21:45 -06:00
dc903460dc fix some imports 2025-03-24 07:59:35 -06:00
df72979606 moved factories to tests 2025-03-24 07:59:35 -06:00
e7a9ee78a8 rename typing.py to custom_types.py for clarity 2025-02-02 07:18:52 -07:00
e0814c9860 move interop tests tools into tests folder 2025-01-25 15:28:32 -07:00
460db3dce8 merge template, fill vars, lint 2025-01-25 14:43:45 -07:00
a3f8db3ecd async-exit-stack was for pre-py37, just import from contextlib now 2024-05-27 12:40:23 -06:00
eea065fb57 reorg test structure to match tox and CI jobs, drop bumpversion for bump-my-version and move config to pyproject.toml, fix docs building 2024-04-20 09:18:26 -06:00
006002f687 Move interop tests out of tests
It is moved to the top level package `tests_interop`, to avoid circular
dependency, with the dependency moved to `tox`.
2019-09-23 22:00:40 +08:00
2d8e02b7eb Add detection for disconnections in mplex 2019-09-19 15:55:26 +08:00
df87f5adb9 Add tests against the daemon for close/reset 2019-09-10 18:01:16 +08:00
1f3c9af45b Add the missing is_proc_running=True 2019-09-04 22:19:11 +08:00
0e3d4508d6 PR feedback
- Use `Sequence` instead of `List`
- Add note
- Remove redundant words in docstring
2019-09-04 20:52:18 +08:00
db0da8083a Do p2pd.close if not all of them succeed 2019-09-04 20:52:17 +08:00
51d547ccc5 Update tests/interop/utils.py
Co-Authored-By: NIC Lin <twedusuck@gmail.com>
2019-09-04 20:38:38 +08:00
b72c489f4e Update tests/interop/daemon.py
Co-Authored-By: NIC Lin <twedusuck@gmail.com>
2019-09-04 20:36:42 +08:00
a843514afb Update tests/interop/daemon.py
Co-Authored-By: NIC Lin <twedusuck@gmail.com>
2019-09-04 20:35:42 +08:00
155f523c9f Update tests/interop/daemon.py
Co-Authored-By: NIC Lin <twedusuck@gmail.com>
2019-09-04 20:33:50 +08:00
bd21b2f66f Update tests/interop/conftest.py
Co-Authored-By: NIC Lin <twedusuck@gmail.com>
2019-09-04 20:33:29 +08:00
dddaacad62 Move install script under tests/interop/go_pkgs 2019-09-04 16:33:25 +08:00
5280f3965c Update install script for interop
And adjust the structure of go packages for interop
2019-09-03 17:41:17 +08:00
749ff275ed Refactor make_p2pd
Let `make_p2pd` get rid of `unused_tcp_port_factory`, which should only
exist in fixtures/tests.
2019-09-03 16:55:42 +08:00
7385a7a677 Add is_gossipsub fixture in interop test
To use the same code to test against both routers: floodsub and
gossipsub.
2019-09-03 16:49:00 +08:00
33dae87c35 Add pubsub test for gossipsub 2019-09-03 16:07:44 +08:00
194b494057 Tested against subscriptions and publish 2019-09-02 23:21:57 +08:00
3717dc9adf Add helper functions 2019-09-02 21:01:13 +08:00
a883816881 Add connect utility function 2019-09-02 18:40:12 +08:00
56ef0b962c Add test for host connect and disconnect 2019-09-02 17:32:15 +08:00
b77834d129 Use asyncio.subprocess over pexpect
In the test for pubsub, since there were unknown issues when I test
against pexpect.
2019-09-02 14:30:27 +08:00