diff --git a/examples/websocket/application_execution.e b/examples/websocket/application_execution.e index 295411bd..99ae28cc 100644 --- a/examples/websocket/application_execution.e +++ b/examples/websocket/application_execution.e @@ -27,7 +27,7 @@ feature -- Basic operations -- To send a response we need to setup, the status code and -- the response headers. if request.path_info.same_string_general ("/app") then - s := websocket_app_html (9090) + s := websocket_app_html (request.server_name, request.server_port) else s := "Hello World!" create dt.make_now_utc @@ -184,7 +184,7 @@ feature -- Command feature -- HTML Resource - websocket_app_html (a_port: INTEGER): STRING + websocket_app_html (a_host: STRING; a_port: INTEGER): STRING do Result := "[ @@ -198,7 +198,7 @@ $(document).ready(function() { function connect(){ - var host = "##WSSCHEME##://127.0.0.1:##PORTNUMBER##/app"; + var host = "##WSSCHEME##://##HOSTNAME##:##PORTNUMBER##/app"; try{ @@ -280,6 +280,7 @@ body {font-family:Arial, Helvetica, sans-serif;} ]" + Result.replace_substring_all ("##HOSTNAME##", a_host) Result.replace_substring_all ("##PORTNUMBER##", a_port.out) if request.is_https then Result.replace_substring_all ("##HTTPSCHEME##", "https")