Skip to content

Add negotiate parameter to wrap_socket (fixes #175) - #195

Merged
kpdyer merged 1 commit into
masterfrom
fix-wrap-socket-negotiate
Jan 10, 2026
Merged

Add negotiate parameter to wrap_socket (fixes #175)#195
kpdyer merged 1 commit into
masterfrom
fix-wrap-socket-negotiate

Conversation

@kpdyer

@kpdyer kpdyer commented Jan 10, 2026

Copy link
Copy Markdown
Owner

The chat example was broken because both client and server were sending negotiation cells when both specified regexes.

Changes:

  • Add negotiate=True parameter to wrap_socket()
  • When negotiate=False, skip negotiation and set up encoders immediately
  • Update chat examples to use negotiate=False
  • Add test for negotiate=False functionality

This allows symmetric use cases where both sides know the formats upfront, while maintaining backwards compatibility with the relay use case (negotiate=True is the default).

The chat example was broken because both client and server were
sending negotiation cells when both specified regexes.

Changes:
- Add negotiate=True parameter to wrap_socket()
- When negotiate=False, skip negotiation and set up encoders immediately
- Update chat examples to use negotiate=False
- Add test for negotiate=False functionality

This allows symmetric use cases where both sides know the formats
upfront, while maintaining backwards compatibility with the relay
use case (negotiate=True is the default).
@kpdyer
kpdyer merged commit c94f075 into master Jan 10, 2026
33 of 34 checks passed
@kpdyer
kpdyer deleted the fix-wrap-socket-negotiate branch January 11, 2026 17:06
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