Instructions
EC2 instance inbound rules
If you are using an EC2 instance on AWS, it is necessary to add the following ports as inbound rules:
- 80
- 11182
- 11000 - 11031
One networking port is required for each Stream Cache Server that is spawned. The port is used for WebSocket communication between the Stream Cache Server and the browser running the HOOPS Web Viewer. In the case above, we have provided 32 ports to instantiate concurrent viewing sessions on ports 11000 - 11031.
IIS Installation
- Start the server manager from the Start menu
- Select Dashboard in the Server Manager and click Add roles and features
- Click Next in the “Before you begin” page of the Add Roles and Feature Wizard
- Select Role-based or feature-based installation in the Select installation type page, and click Next
- Choose to Select a server from the server pool in the “Select destination server” page, select a server and click Next
- Select Web Server (IIS) in the “Select server roles” page, and click Next
- Click Next in the “Select features” page
- Click Next
- Select WebSocket Protocol of the Application Development in the “Select role service” page
- Click Next
- Click Install
- Click Close when the installation is completed
Enabling IE
- Select Local Server in the Server Manager
- Click On for IE Enhanced Security Configuration in the PROPERTIES
- Select off for Administrators:
- Click OK
- Open the Control Panel from the Start menu
- Click Network and Internet
- Click Internet Options
- Select the Programs tab
- Select Open Internet Explorer tiles on the desktop
- Click OK
- Open http://localhost using IE verify whether default page appears properly:
Adding WebAssembly file type (.wasm) to MIME types in IIS
- Open the Windows Control Panel
- Click System and Security
- Click Administrative Tools
- Double-click Internet Information Service (IIS) Manager
- Select Default Web Site in the left-hand tree:
- Double-click MIME Type
- Click Add… in the right panel
- Type “.wasm” for File name extension and “application/wasm” as MIME type, and click OK:
Install a supported browser (optional)
If you don’t have at least IE 11 installed on your machine, you’ll need to install a supported browser to view models on your server machine. This is not a step you’ll likely do on a production server
Here is the list of Supported Platforms for the WebViewer.
Install HOOPS Communicator
- Download the latest version of HOOPS Communicator and your license key from the Tech Soft 3D Developer Zone.
- Create a folder named “HC” in the wwwroot folder of the web server (C:\inetpub\wwwroot).
- Run the HOOPS Communicator and install wherever you’d prefer.
- Copy all the files from \web_viewer\src into C:\inetpub\wwwroot\HC.
- Launch Communicator, by navigating to \quick_start and running start_server.bat
- Open http://localhost/HC/hoops_web_viewer_sample.html?wsPort=11182&instance=microengine using a supported browser to verify you have installed and configured HOOPS Communicator correctly:
- Stop Communicator by closing the cmd window it opened up in.
Add a new inbound rule
- Open the Windows Control Panel
- Click System and Security
- Click Windows Firewall
- Click Advanced settings
- Select Inbound Rules and click New Rule…
- Select Port in the “Rule Type” page of the New Inbound Rule Wizard, and click Next
- Add “11182, 11000-11031” to the Specific local ports:
- Click Next
- Select Allow the condition, and click Next
- Select Public, and click Next
- Input “HC” as the rule name, and click Finish
HOOPS Communicator Configuration for external access
- Open the file \server\node\Config.js
- Edit the publicHostName variable to point to the public IP address for your machine:
- Run <HOOPS Communicator install Dir\server\node\start_server.bat
- Open http://<YourPublicIPAddress/HC/hoops_web_viewer_sample.html? wsPort=11182&instance=microengine using a web browser on an external machine and verify the HOOPS Web Viewer appears properly
- Close the cmd window where you launched start_server.bat
Application Request routing (ARR) installation
- Go to the Microsoft Web Platform Installer website:
https://www.microsoft.com/web/downloads/platform.aspx - Click Install this extension and run the installer
- Install the Web Platform Installer
- Start Web Platform Installer after installation
- Search for ARR and click Add of Application Request Routing 3.0
- Click Install
- Click I Accept
- Click Finish when the installation is complete
Reverse proxy URL rewriting
- Open the Windows Control Panel
- Click System and Security
- Click Administrative Tools
- Double-click Internet Information Service (IIS) Manager
- Select Default Web Site in the left hand tree:
- Double-click URL Rewrite
- Click Add Rule(s)… in the right panel:
- Select Reverse Proxy and click OK
- Click OK to enable proxy functionality
- Click Cancel
- Open the web.config file in root folder of current web site (C:\inetpub\wwwroot) and add the following rewrite rules:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer><staticContent>
<mimeMap fileExtension=".wasm" mimeType="application/wasm" />
</staticContent>
<rewrite>
<rules>
<rule name="Rewrite to httpproxy" enabled="true">
<match url="^httpproxy/([0-9]+)/([_0-9a-z-]+)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{CACHE_URL}" pattern="^(.+)://([.0-9]+)" />
</conditions>
<action type="Rewrite" url="{C:1}://172.31.27.239:{R:1}/{R:2}" />
</rule>
<rule name="Rewrite to wsproxy" enabled="true">
<match url="^wsproxy/([0-9]+)" negate="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{CACHE_URL}" pattern="^(.+)://([.0-9]+)" />
</conditions>
<action type="Rewrite" url="{C:1}://172.31.27.239:{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
- Edit line 223 of \HC\js\sample.js (the root folder is usually C:\inetpub\wwwroot):
var brokerUri = window.location.protocol + "//" + window.location.hostname + ":" + brokerPort;
if (Sample._getProxy())
brokerUri=window.location.protocol+"//"+window.location.hostname+"/httpproxy/"+brokerPort;
- Run \server\node\start_server.bat
- Open http://xxx.xxx.xxx.xxx/HC/hoops_web_viewer_sample.html?broker=true&proxy=true&instance=microengine using a web browser on an external machine and verify that the HOOPS Web Viewer is appearing as expected
- Close the server cmd window (shutting the server down)
Inbound rule modification
The reverse proxy has now been configured, but there are still some non-standard ports
that are open to the internet, posing a security risk. We’ll need to close them by restricting the non-standard ports to the private environment. It’s important the user minimizes exposure to the public zone.
Here is an illustration of what the system looks like after above configuration:
And after the modification:
Configuring the private environment:
- Open Advanced settings of Windows Firewall
- Double-click HC from Inbound Rules
- Click Advanced tab and select Private only in the Profiles:
- Click OK
- Now, HOOPS Web Viewer cannot be opened from external machine.
- If you are using EC2 instance of AWS, it is also necessary to edit the Inbound
rules:
URL Rewrite rule modification
Edit the \web.config file and replace the Rewrite rules with your private address:
<?xml version="1.0" encoding="UTF-8"?>
...
<rewrite>
<rules>
<rule name="Rewrite to httpproxy" enabled="true">
<match url="^httpproxy/([0-9]+)/([_0-9a-z-]+)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{CACHE_URL}" pattern="^(.+)://([.0-9]+)" />
</conditions>
<action type="Rewrite" url="{C:1}://yyy.yyy.yyy.yyy:{R:1}/{R:2}" />
</rule>
<rule name="Rewrite to wsproxy" enabled="true"><match url="^wsproxy/([0-9]+)" negate="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{CACHE_URL}" pattern="^(.+)://([.0-9]+)" />
</conditions>
<action type="Rewrite" url="{C:1}://yyy.yyy.yyy.yyy:{R:1}" />
</rule>
</rules>
</rewrite>
...
yyy.yyy.yyy.yyy is your private IP address.
Test the HOOPS Web Viewer
- Launch \server\node\start_server.bat
- Open http://xxx.xxx.xxx.xxx/HC/hoops_web_viewer_sample.html?broker=true&proxy=true&instance=microengine using a web browser on an external machine and verify whether HOOPS Web Viewer appears properly