今天没有.NET 4.5主机可以使用Web套接字吗?(Can web sockets be used today without a .NET 4.5 host?)

编程入门 行业动态 更新时间:2024-10-09 22:17:46
今天没有.NET 4.5主机可以使用Web套接字吗?(Can web sockets be used today without a .NET 4.5 host?)

我希望通过云服务将我的WinJS应用程序连接到移动浏览器客户端,每个人都使用网络套接字连接。

我使用socket.io构建了一个解决方案,只要我的node.js服务器托管在localhost上就可以正常运行:)当我将服务器部署到Azure时,Windows 8应用程序返回一个错误,说它无法加载外部内容。本地上下文(在调用socket.io的connect()之后)。

查看MSDN上的Web套接字示例,我认为我应该使用Windows.Networking.Sockets中的内置功能,至少在我的应用程序和公共云服务之间的内容,因为它不会尝试加载外部资源。

我的问题是:隧道另一端有哪些选择? 是否需要带有IIS 8的.NET 4.5主机(因为IIS 7不支持WS)? 我认为今天还没有,所以我想知道这里的发展故事是什么。

根据我最终用于服务器的内容,我想我必须再次使用socket.io或SignalR来为客户端服务(大多数不支持Web套接字,我需要一个良好的跨浏览器库:))

I'm looking to connect my WinJS app to mobile browser clients via a cloud service that everyone connects to using web sockets.

I built a solution using socket.io that works well as long as my node.js server is hosted on localhost :) When I deploy my server to Azure, the Windows 8 app returns an error saying it can't load external content in a local context (after calling socket.io's connect()).

Looking at the web sockets sample on MSDN, I think that I should use the built-in functionality in Windows.Networking.Sockets for at least what's between my app and the public cloud service as it won't try to load external resources.

My question is: what are the options for the other end of the tunnel? Does it require a .NET 4.5 host with IIS 8 (since IIS 7 doesn't support WS)? I don't think those exist today yet, so I'm wondering what the development story is here.

Depending on what I end up using for the server, I think I'll have to use socket.io again or SignalR to serve the clients (most won't support web sockets and I need a good cross-browser library :))

最满意答案

如果您的后端是NodeJS应用程序,则不需要 IIS服务器或与.NET Framework相关的任何内容。

NodeJS的作者在https://github.com/joyent/node/wiki/Node-Hosting上维护了托管服务提供商列表(该列表可能已过时,因为我在那里看不到Azure)。

我不明白为什么您的服务器在部署到Azure时不应该工作。 你在使用npm install azure吗?


我觉得你对Web套接字Socket.io感到困惑。

Socket.io是一个实时传输框架, 可能会可能不会使用Web套接字在客户端基于客户端的浏览器进行传输。

参考: FAQ - Socket.IO

(Answering my own question) I was behind a proxy that didn't allow the web socket connection from socket.io in my Win8 app through, and so it fell back on a method that required loading external resources.

Bypassing that problematic proxy, the connection works fine and I can use socket.io from my app as intended. I'm hosting the other end on Azure (per the node.js + socket.io tutorial they provide) and it works. I still don't know what a developer wanting to use the built-in web sockets library should use for a host, but I imagine we have to wait for IIS 8 to be out.

Now I'm left to verify that the app can pass certification with this library.

更多推荐

本文发布于:2023-08-07 12:41:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464306.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可以使用   主机   NET   Web   today

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!