Skip to content

Conversation

lla-dane
Copy link
Contributor

@lla-dane lla-dane commented Oct 7, 2025

Added sni protocol in py-multiaddr in reference with go-multiaddr

SNI had the same codec configs as DNS in go-multiaddr

protoSNI = Protocol{
	Name:       "sni",
	Size:       LengthPrefixedVarSize,
	Code:       P_SNI,
	VCode:      CodeToVarint(P_SNI),
	Transcoder: TranscoderDns,
}

So just added this line in the protocol registry

Protocol(P_SNI, "sni", "domain"),

Did the same thing with noise

"/ip4/127.0.0.1/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234/unix/stdio",
"/dns/example.com",
"/dns4/موقع.وزارة-الاتصالات.مصر",
"/ip4/127.0.0.1/tcp/443/tls/sni/example.com/http/http-path/foo",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added a test case for sni multiaddr as given in go-multiaddr tests

@lla-dane
Copy link
Contributor Author

lla-dane commented Oct 7, 2025

@acul71: Can you please take a look why these checks are failing with my changes, I am not understanding.

@lla-dane lla-dane changed the title Add sni protocol in py-multiaddr Add SNI and NOISE protocol in py-multiaddr Oct 7, 2025
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