wintercg / proposal-sockets-api

Proposal for an API for establishing TCP connections in Non-Browser JavaScript runtime environments
https://sockets-api.proposal.wintercg.org/
Other
46 stars 2 forks source link

Unix sockets #16

Open mmastrac opened 9 months ago

mmastrac commented 9 months ago

Deno currently provides the ability to connect to a unix socket. While I believe there is no standard for unix socket addresses URIs, a few ad-hoc standards do exist for this. Ideally the connection standard should make it reasonably easy for implementers to provide additional platform-specific socket types.

Some discussion around this in WhatWG: https://github.com/whatwg/url/issues/577

dom96 commented 9 months ago

Agreed we need to make a decision on this. From what I see in that WhatWG thread it seems there isn't consensus on how to fit it into the url standard (though I did mainly skim read it).

jasnell commented 9 months ago

I think we can go ahead and allow for flexibility here and just say that in connect(destination), the destination MAY be an absolute URL string, and that if it is, it is up to the host implementation to determine if the URL scheme is supported or not.

jasnell commented 9 months ago

This would be helpful, btw, if we do end up supporting SNI and ALPN as discussed in other issues. For instance,

connect('https://example.org') could automatically set secureTransport: 'on', set the SNI to 'example.org', and configure the ALPN for h1, etc.