To enable the traffic routing from IIS to AcuToWeb Gateway, use the following steps:
- Enable WebSocket support:
- On the
Add Roles and Features Wizard, select
Server Roles.
- In the Roles pane, under
, select
WebSocket Protocol.
- Download and install Application Request Routing (ARR 3.0):
http://www.iis.net/downloads/microsoft/application-request-routing
- Download and install URL Rewrite:
http://www.iis.net/downloads/microsoft/url-rewrite
- Configure ARR as a forward proxy:
- Double-click
Application Request Routing Cache.
- Click
Server Proxy Settings.
- Select
Enable Proxy, then click
Apply.
- Configure URL Rewrite:
- Double-click
URL Rewrite.
- Click
Add Rules, then click
Blank rule.
- In the Edit Inbound Rule dialog box, type
WebSocket Proxy in the Name field.
- Select
Wildcards in the Using field.
- Select
websocket* in the Pattern field.
- In the Conditions section, click
Add.
- Type
{HTTP_CONNECT} in the Condition Input field.
- Select
Matches the Pattern in the Check if input string field.
- Type
* in the Pattern field, then click
OK.
- In the Action section, select
Rewrite in the Action Type field.
- 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).
- Check
Stop Processing.
- 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:8009/websocket
|
http://<public ip>/gateway
|
http://127.0.0.1:8009/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