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

Use `URL` for SocketAddress #7

Closed Ethan-Arrowood closed 10 months ago

Ethan-Arrowood commented 10 months ago

Should the connect method work with a URL instance as the first parameter?

URL is a web api just like Steams so i think its sufficient to include it

dom96 commented 10 months ago

A URL object should already fit the SocketAddress dictionary defined in the spec (URL has port and hostname fields). Not sure we need to be explicit about allowing URL.

Ethan-Arrowood commented 10 months ago

Yeah thats right. I didn't realize that at first, but totally makes sense. No reason to specifically constrain it