chronoxor / NetCoreServer

Ultra fast and low latency asynchronous socket server & client C# .NET Core library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
https://chronoxor.github.io/NetCoreServer
MIT License
2.76k stars 575 forks source link

How I can connect with WebSocket server as a web socket client #92

Open zydjohnHotmail opened 4 years ago

zydjohnHotmail commented 4 years ago

Hello: I just found your repo., I think it is a good one, as I need such package for one of my C# .Net core project. But I tried a little bit, I can't find good code example to connect with a secure web socket server for testing. For example, if I want to connect this WebSocket Echo server: wss://echo.websocket.org Then how I can write the connection part of the code. Your code example seems recognize only the IP address, but I need wss:// URL address. Besides, I don't know the port number for such secure web socket server, how I can pick up one? Or use port #431? Please provide C# code example. Thanks,

raymond-holmboe commented 3 years ago

I need to do the same thing, how can I connect to a wss URL?

chronoxor commented 3 years ago
IPAddress address = Dns.GetHostAddresses("google.com").FirstOrDefault();