Configuring IIS

Note: You must use IIS version 8 or later, as this provides WebSocket support; IIS version 8 is supported on Windows Server 2012 and later. For more information, visit http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support.

To enable the traffic routing from IIS to AcuToWeb Gateway, use the following steps:

  1. Enable WebSocket support:
    1. On the Add Roles and Features Wizard, select Server Roles.
    2. In the Roles pane, under Web Server > Application Development, select WebSocket Protocol.
  2. Download and install Application Request Routing (ARR 3.0): http://www.iis.net/downloads/microsoft/application-request-routing
  3. Download and install URL Rewrite: http://www.iis.net/downloads/microsoft/url-rewrite
  4. Configure ARR as a forward proxy:
    1. Double-click Application Request Routing Cache.

    2. Click Server Proxy Settings.
    3. Select Enable Proxy, then click Apply.
  5. Configure URL Rewrite:
    1. Double-click URL Rewrite.

    2. Click Add Rules, then click Blank rule.
    3. In the Edit Inbound Rule dialog box, type WebSocket Proxy in the Name field.
    4. Select Wildcards in the Using field.
    5. Select websocket* in the Pattern field.
    6. In the Conditions section, click Add.
    7. Type {HTTP_CONNECT} in the Condition Input field.
    8. Select Matches the Pattern in the Check if input string field.
    9. Type * in the Pattern field, then click OK.
    10. In the Action section, select Rewrite in the Action Type field.
    11. Type http://<gateway ip>:<gateway port>/{R:0} in the Rrewrite URL field (where <gateway ip>:<gateway port> are the IP and port number of your AcuToWeb Gateway).
    12. Check Stop Processing.
    13. Repeat from step b., and add two more rules, as shown here:

Important: Due a limitation of ARR 3.0, this component does not support compressed WebSocket frames; therefore, IIS is not capable of routing them. To make the WebSocket Proxy rule work, the WebSocket protocol must be enabled on the root node, but compression must not be enabled on the AcuToWeb node; add "ws_compression" : 0, to your gateway configuration file.

When all three rules are properly configured, the IIS-hosted site is able to route all the communications towards the AcuToWeb Gateway. Those rules are triggered using filters on the URL path, so now only port 80 (the http port) will be open to the public network.

Public URL Routed to
http://<public ip>/* http://127.0.0.1:3000/*
ws://<public ip>/websocket http://127.0.0.1:8008/websocket
http://<public ip>/gateway http://127.0.0.1:8008/gateway
Important:

With this configuration, the AcuToWeb Gateway is hidden behind IIS and it only reachable by using the HTTP port; therefore, it is mandatory to use the portgw parameter to override the gateway configuration; for example:

http://12.345.678.912?hostgw=12.345.678.912&portgw=80&alias=tour