Why should we use WebSocket Proxy?

This is the first in a series of
posts on WebSocket proxy configuration.

ColdFusion uses dedicated port
(8575/8577) to start its internal WebSocket Server by default. Earlier, these
ports were required to be always accessible from outside. This setup works well
for intranet applications. But for public facing web applications, it is not
advisable to keep port open and let it be accessible from outside.

ColdFusion 11 has introduced
proxy support for WebSocket. There is a new proxy module that can be configured
with IIS and Apache Web Server which intercept ColdFusion WebSocket requests
and redirect the requests to the ColdFusion’s internal WebSocket Server.
Now, web applications communicate to WebSocket server over the same port on
which web application is running.

How to start WebSocket proxy

In order to start WebSocket proxy
service follow steps mentioned below:

  • Login to ColdFusion Administrator.
  • Navigate to Server Settings > WebSocket.
  • Select “Use Proxy” option under Enable WebSocket Service.
  •  Submit Changes.
  • Restart ColdFusion Application service.

    How to configure WebSocket proxy
    with ColdFusion?

    We have shipped WebSocket Proxy
    Configuration tool along with ColdFusion 11 which can be used to configure WebSocket
    proxy with IIS and Apache Web Server on all supported platforms.

    WebSocket Proxy Configuration tool
    can be located at:

    •  <cf_install_root>/cfusion/bin/wsproxyconfig.exe(for
      windows platform
    •  <cf_install_root>/cfusion/bin/wsproxyconfig.sh(for
      non-windows platform

    Supported web servers with
    WebSocket proxy:

    • IIS
      8 or above
    • Apache
      Web Server 2.2.*

    Upcoming posts in this series:

    • How to configure WebSocket proxy
      with IIS
    • How to configure WebSocket proxy
      with Apache Web Server
    • Tuning ColdFusion 11 WebSocket
      proxy configuration with IIS 8 or above


    7 Responses

    1. The provided config tool generates:

      LoadModule websocket_module “C:ColdFusion11configwsproxy1mod_websocket.so”

      SetHandler websocket-handler
      WebSocketHandler “C:ColdFusion11configwsproxy1mod_wsproxy.so” _proxy_init@0

      When using this tool with Apache 2.4.x you get these two errors:

      >>> httpd.exe: Syntax error on line 551 of D:/Apache24/conf/httpd.conf: Syntax error on line 1 of C:/ColdFusion11/config/wsproxy/1/mod_wsproxy.conf: API module structure ‘websocket_module’ in file C:/ColdFusion11/config/wsproxy/1/mod_websocket.so is garbled –

      The Apache service named reported the following error:
      >>> expected signature 41503234 but saw 41503232 – perhaps this is not an Apache module DSO, or was compiled for a different Apache version?

      This makes me think that these are not compiled for Apache 2.4.x

      We tried downloading and using a custom compiled version of mod_websocket.so that is supposed to work with Apache 2.4.x. We got the version here : http://fossies.org/windows/www/httpd-modules-2.4-win64-VC11.zip/index_o.html. You can read here how it was created: http://fossies.org/windows/www/httpd-modules-2.4-win64-VC11.zip/mod_websocket/mod_websocket/README.md

      This let us actually start Apache but then we got this error:

      The Apache service named reported the following error:?>>> AH00526: Syntax error on line 6 of C:/ColdFusion11/config/wsproxy/1/mod_wsproxy.conf: .
      The Apache service named reported the following error:?>>> Could not find initialization function in module .
      WebSocketHandler “C:ColdFusion11configwsproxy1mod_wsproxy.so” _proxy_init@0

      Let me know if you have had any luck getting this setup to work in Apache 2.4.x



    Leave a reply