简体   繁体   English

在C#SSL WebSocket客户端是.net 4.0吗?

[英]is there in C# SSL WebSocket Client that is .net 4.0?

I was wondering if there is anything on this subject at the moment: I have found various examples EG: the 4.5 system.net.websockets.websocket for ssl (wss://) clients in c# and I was wondering if there were any reliable ssl versions out there since this similar question was answered. 我想知道目前是否有任何关于这个主题的内容:我已经找到了各种例子EG: c#的4.5s system.net.websockets.websocket for ssl(wss://)客户端我想知道是否有可靠的ssl版本在那里,因为这个类似的问题得到了回答。

But I am developing in Visual c# 2010, a winforms C# client application that has to receive server pushes, but it's Windows 7 so I can't us net 4.5 . 但是我在Visual c#2010中开发,这是一个winforms C# 客户端应用程序,必须接收服务器推送,但它是Windows 7所以我不能使用net 4.5。 (Note: the emphasis on the client ) (注:强调客户端

If anyone has any actual code for SSL (hopefully one that doesn't necessarily enforce the certificate authentication prompt) I would appreciate it - I prefer code samples - but I'll take a namespace solution. 如果任何人有任何实际的SSL代码(希望一个不一定强制执行证书身份验证提示)我会很感激 - 我更喜欢代码示例 - 但我会采用命名空间解决方案。

Thanks in advance:-) 提前致谢:-)

Websocket4net is working with SSL, we are developing a system with Jetty/websocket on server side. Websocket4net正在使用SSL,我们正在服务器端开发一个带Jetty / websocket的系统。 This is a sample snippet with authentication: 这是一个带身份验证的示例代码段:

webSocket = new WebSocket("wss://host:8443/", "echo", null,
new List < KeyValuePair < string, string >> () {
    new KeyValuePair < string, string > ("Authorization", "Basic YWRtaW46YWRtaW4=")
}, "", WebSocketVersion.Rfc6455);
webSocket.EnableAutoSendPing = true;
webSocket.AllowUnstrustedCertificate = true;

The question is very old, but this answer helps others... 问题很老,但这个答案有助于其他人......

So you can use .NET 4.5 in Windows 7, you just need to download the right version (on msdn.com it has the dl for Win 8) of Visual Studio . 因此,您可以在Windows 7中使用.NET 4.5,您只需要下载Visual Studio的正确版本(在msdn.com上,它具有Win 8的dl)。

Example connection 示例连接

Example of Working with a TCP Version 使用TCP版本的示例

General WebSocket documentation 一般WebSocket文档

我认为这可能适合您: http//websocket4net.codeplex.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM