asp.net - IIS hosted web core and websockets -


i have web app uses new websocket feature of asp.net 4.5. have custom handler following:

public class websockethandler : ihttphandler {     public void processrequest(httpcontext context)     {         if (context.iswebsocketrequest)         {             context.acceptwebsocketrequest(websocketrequest);         }     }      public bool isreusable { { return false; } }      private async task websocketrequest(aspnetwebsocketcontext context)     {          //processing     } } 

this works when host app on iis 8, when run app in iis hosted web core, iswebsocketrequest property fasle.

so, questin is: iis 8 hosted web core supports websockets , if does, need enable it?

well, i've figured out hwc does support websockets fact iis express 8 does, , wrapper on hwc. after i've examined iis express applicationhost.config , found there few things there i've missed.

the complete list of changes i've made hwc applicationhost.config enable websockets support following:

  • add <section name="websocket" overridemodedefault="deny" /> element <sectiongroup name="system.webserver"> of <configsections>
  • add <websocket /> element <system.webserver>
  • add <add name="websocketmodule" image="%windir%\system32\inetsrv\iiswsock.dll" /> element <globalmodules>
  • add <add name="websocketmodule" lockitem="true" /> element <modules>

after websockets worked charm.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -