IIS7中配置WebOrb支持RTMPT

项目中用到WebOrb的Real-time messaging,考虑到rtmp协议需要配置服务器防火墙打开2037端口,最终选择rtmpt协议。配置中遇到一些麻烦,主要是iis7还是不熟悉,经过一番周折还是搞定了。以下是WebOrb官方的配置指导:

http://www.themidnightcoders.com/fileadmin/docs/dotnet/guide/index.htm

WebORB provides support for RTMPT thus enabling communication between real-time messaging clients and server applications, streams and remote shared objects over port 80. There are special configuration requirements for RTMPT:

  1. WebORB must be deployed in the root of a website.
  2. Special HTTP handler mappings must be added to web.config
  3. The website must be configured to route POST requests via ASP.NET

Follow the steps described below to configure IIS and WebORB to process RTMPT requests:

  1. Configure website root to run as an application.

    Open IIS Manager and select the root node for the website where RTMPT must be enabled. Open the Properties window and select the 'Home Directory' tab:
    rtmpt.1.gif

    In the Application Settings section, make sure there is an application associated with the website. If not, click the Create button to the right from the Application name field.
     
  2. Configure application to route requests through ASP.NET.
     
    iis5.jpgiis6_clic.jpg
    Click the Configuration button in the Application Settings section of the Home Directory tab.
    rtmpt.2.gif

    Click the Add button and enter the following data as shown in the image below:

    Executable:     full path to aspnet_isapi.dll for your .NET installation.
    (path in our testing environment is c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll)
    Extension:     .*
    Limit to:        POST
    "Script engine" check box: checked
    "Check that file exists": unchecked

    rtmpt.3.gif

    Click OK, to accept the values.

     

    Click the Configuration button in the Application Settings section of the Home Directory tab.

    rtmpt.6.gif

    Click "Insert..." to add a wildcard application map and enter the full path to aspnet_isapi.dll for your .NET installation.
    (path in our testing environment is c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll).
    Make sure to uncheck the "Verify that file exists" checkbox.

    rtmpt.5.gif

    Click OK to accept the values.
  3. Deploy WebORB in the website root.

    Create "bin" folder and copy the following assemblies from the default WebORB installation path (wwwroot/weborb30/bin):
    • weborb.dll
    • cpuinfo.dll
    • Npgsql.dll
    • NHibernate.dll
    • MySql.Data.dll
    • Mono.Security.dll
    • any assemblies with user application code

    Copy weborb.config into the website root folder.
     

  4. Deploy messaging applications.

    Create /Applications folder in the website root folder. Create subfolders corresponding to the messaging applications. A subfolder may contain application configuration file (app.config) with a reference to the application handler class
     
  5. Register WebORB RTMPT handler.

    If there is no web.config in the website root folder, copy it from the default WebORB installation directory (wwwroot/weborb30).

    Add the following configuration to the <httpHandlers> section:

    <add verb="*" path="/open/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler"/>
    <add verb="*" path="/send/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler"/>
    <add verb="*" path="/idle/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler"/>
    <add verb="*" path="/close/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler"/>
    <add verb="*" path="/open/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler"/>
    <add verb="*" path="/send/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler"/>
    <add verb="*" path="/idle/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler"/>
    <add verb="*" path="/close/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler"/>
     

IIS7中的设置

选择"Handler Mappings" -> "Add Wildcard Script Map..."

 2010012910565945.jpg

Choose aspnet_isapi.dll as an executable and give this script mapping some meaningful name, such as ASP.NET-ISAPI-2.0-Wildcard. After that click OK and then click Yes in the "Add Wildcard Script Map" dialog.

2010012910575149.jpg

 

Next, switch to the ordered list view for the handler mappings by clicking on "View Ordered List..." action and move the newly created mapping to the bottom of the list just before the StaticFile handler mapping:

2010012910581632.jpg

最关键的一点,对应官方给的II6中配置第五步,添加相应的托管HttpHandler(IIS7的Handler Mappings右侧 Add Managed Handler...)

 2010020313452117.png

根据官方第5步Register WebORB RTMPT handler.填写相应的请求路径

2010020313494495.png

全部加好后:

2010020313531311.png

比较一下IIS6和IIS7的Web.config不同之处

IIS6:

<system.web>

<httpHandlers>

      <add verb="*" path="/open/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" />
      <add verb="*" path="/send/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" />
      <add verb="*" path="/idle/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" />
      <add verb="*" path="/close/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" />
      <add verb="*" path="/open/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" />
      <add verb="*" path="/send/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" />
      <add verb="*" path="/idle/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" />
      <add verb="*" path="/close/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" />
      <add verb="*" path="weborb.aspx" type="Weborb.ORBHttpHandler" />
      <add verb="*" path="codegen.aspx" type="Weborb.Management.CodeGen.CodegeneratorHttpHandler" />
    </httpHandlers>

...

</system.web>

IIS7:(注意IIS7中会使用最下面的  <system.webServer>节点)

  <system.webServer>

    <handlers>

      <add name="rtmptHttpHandler1" verb="*" path="/open/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" resourceType="Unspecified" preCondition="integratedMode"/>

      <add name="rtmptHttpHandler2" verb="*" path="/send/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" resourceType="Unspecified" preCondition="integratedMode"/>

      <add name="rtmptHttpHandler3" verb="*" path="/idle/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" resourceType="Unspecified" preCondition="integratedMode"/>

      <add name="rtmptHttpHandler4" verb="*" path="/close/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" resourceType="Unspecified" preCondition="integratedMode"/>

      <add name="rtmptHttpHandler5" verb="*" path="/open/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" resourceType="Unspecified" preCondition="integratedMode"/>

      <add  name="rtmptHttpHandler6" verb="*" path="/send/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" resourceType="Unspecified" preCondition="integratedMode"/>

      <add name="rtmptHttpHandler7" verb="*" path="/idle/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" resourceType="Unspecified" preCondition="integratedMode"/>

      <add name="rtmptHttpHandler8" verb="*" path="/close/*/*" type="Weborb.Messaging.Net.RTMPT.RTMPTHttpHandler" resourceType="Unspecified" preCondition="integratedMode"/>

      <add name="codegen.aspx_*" path="codegen.aspx" verb="*" type="Weborb.Management.CodeGen.CodegeneratorHttpHandler" preCondition="integratedMode,runtimeVersionv2.0" />

      <add name="weborb.aspx_*" path="weborb.aspx" verb="*" type="Weborb.ORBHttpHandler" preCondition="integratedMode,runtimeVersionv2.0" />

    </handlers>

   ...

  </system.webServer> 

  

 

 

 

另外,值得一提的是flex代码中的NetConnection实例的uri要做相应修改

例如

原:"rtmp://192.168.1.123:2037/Chat/"

修改后::"rtmpt://192.168.1.123/Chat/"

 

转载于:https://www.cnblogs.com/lutzmark/archive/2010/01/29/1659054.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值