Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ feature -- Initialization
make (a_uri: STRING; a_protocols: detachable LIST [STRING])
do
initialize (a_uri, a_protocols)
create implementation.make (create {NULL_WS_CLIENT}, a_uri)
create implementation.make (create {WEB_SOCKET_NULL_CLIENT}, a_uri)
end

make_with_port (a_uri: STRING; a_port: INTEGER; a_protocols: detachable LIST [STRING])
do
initialize_with_port (a_uri, a_port, a_protocols)
create implementation.make (create {NULL_WS_CLIENT}, a_uri)
create implementation.make (create {WEB_SOCKET_NULL_CLIENT}, a_uri)
end

feature -- Access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</option>
<setting name="concurrency" value="thread"/>
<library name="base" location="$ISE_LIBRARY/library/base/base-safe.ecf"/>
<library name="web_socket_client" location="../../client/web_socket_client-safe.ecf" readonly="false"/>
<library name="web_socket_client" location="../../web_socket_client-safe.ecf" readonly="false"/>
<cluster name="ws_client" location=".\" recursive="true">
<file_rule>
<exclude>/EIFGENs$</exclude>
Expand Down
45 changes: 0 additions & 45 deletions client/src/client/null_ws_client.e

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion client/src/client/web_socket.e → client/src/web_socket.e
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ deferred class

inherit

WEB_SOCKET_CONSTANTS
WS_CONSTANTS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keep WEB_SOCKET_ prefix, to be consistent with the previous changes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that all classes on protocol and server side are prefixed WS_ ... so I tried to apply that for constants as well.
maybe I am wrong, I don't really mind to use WEB_SOCKET_ prefix instead.
we just need to be consistent.

For the client, I kept this prefix, because WS_SOCKET .. was a bit weird, but could also be possible


feature -- Access

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions client/src/web_socket_null_client.e
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
note
description: "[
Objects that is used to create dummy web socket client object
used for void-safety
]"
author: "$Author$"
date: "$Date$"
revision: "$Revision$"

class
WEB_SOCKET_NULL_CLIENT

inherit
WEB_SOCKET_SUBSCRIBER

feature -- Handshake

on_websocket_handshake (request: STRING)
-- Default do nothing
do
end

feature -- TCP connection

connection: TCP_STREAM_SOCKET
do
create Result.make_ssl_client_by_port (0, "null")
end

end
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</option>
<setting name="concurrency" value="thread"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="web_socket_client" location="..\client\web_socket_client-safe.ecf" readonly="false">
<library name="web_socket_client" location="..\web_socket_client-safe.ecf" readonly="false">
<option debug="true">
<debug name="ws" enabled="true"/>
</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<library name="net_ssl" location="$ISE_LIBRARY\unstable\library\network\socket\netssl\net_ssl-safe.ecf"/>
<library name="thread" location="$ISE_LIBRARY\library\thread\thread-safe.ecf"/>
<library name="uri" location="$ISE_LIBRARY\library\text\uri\uri-safe.ecf"/>
<cluster name="protocol" location="..\..\..\protocol\" recursive="true"/>
<cluster name="web_socket_client" location=".\" recursive="true">
<cluster name="protocol" location="..\protocol\" recursive="true"/>
<cluster name="web_socket_client" location=".\src" recursive="true">
<file_rule>
<exclude>/EIFGENs$</exclude>
<exclude>/CVS$</exclude>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ note
revision: "$Revision$"

class
WEB_SOCKET_CONSTANTS
WS_CONSTANTS

feature -- Constants

Expand Down
2 changes: 1 addition & 1 deletion protocol/ws_frame.e
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class
inherit
ANY

WEB_SOCKET_CONSTANTS
WS_CONSTANTS

create
make,
Expand Down
20 changes: 11 additions & 9 deletions server/example/echo_websocket_server/application.e
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,16 @@ feature {NONE} -- Initialization
-- Run application.
local
app_cfg: APPLICATION_CONFIGURATION
l_cfg: HTTP_SERVER_CONFIGURATION
cfg: HTTP_SERVER_CONFIGURATION
do
create app_cfg.make
app_cfg.set_document_root (default_document_root)
set_app_configuration (app_cfg)

create l_cfg.make
setup (l_cfg, a_port)
-- l_cfg.mark_secure
-- -- Change the following files to your own files.
-- l_cfg.set_ca_crt ("C:\OpenSSL-Win64\bin\ca.crt")
-- l_cfg.set_ca_key ("C:\OpenSSL-Win64\bin\ca.key")
-- l_cfg.set_ssl_protocol ({SSL_PROTOCOL}.ssl_3)
create cfg.make
setup (cfg, a_port)

create server.make (l_cfg, create {separate APPLICATION_FACTORY})
create server.make (cfg, create {separate APPLICATION_FACTORY})
end

make
Expand All @@ -50,6 +45,13 @@ feature {NONE} -- Initialization

setup (a_cfg: HTTP_SERVER_CONFIGURATION; a_port: INTEGER)
do
if a_cfg.has_ssl_support then
a_cfg.mark_secure
a_cfg.set_ca_crt ("C:\OpenSSL-Win64\bin\ca.crt") -- Change to use your own crt file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to find a way to configure the ssl certs based on an external configuration file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree for a real ws server, but for this demo, this is ok this way for now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And to be able to use in on Unix...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact, I think we could provide simple ca.* file .. for "localhost"
and in the example, use relative path.

Javier do you think this is doable?

Otherwise, yes we could use a .ini or json based configuration file.

On Thu, May 15, 2014 at 4:12 PM, oligot notifications@github.com wrote:

In server/example/echo_websocket_server/application.e:

@@ -50,6 +45,13 @@ feature {NONE} -- Initialization

setup (a_cfg: HTTP_SERVER_CONFIGURATION; a_port: INTEGER)
    do
  •       if a_cfg.has_ssl_support then
    
  •           a_cfg.mark_secure
    
  •           a_cfg.set_ca_crt ("C:\OpenSSL-Win64\bin\ca.crt") -- Change to use your own crt file.
    

And to be able to use in on Unix...


Reply to this email directly or view it on GitHubhttps://github.com//pull/7/files#r12690893
.

a_cfg.set_ca_key ("C:\OpenSSL-Win64\bin\ca.key") -- Change to use your own key file.
a_cfg.set_ssl_protocol_to_ssl_3
end

a_cfg.http_server_port := a_port
a_cfg.set_max_concurrent_connections (50)
debug ("nino")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
<debug name="ws" enabled="true"/>
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>


<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf">
<option>
<assertions precondition="true"/>
</option>
</library>
<library name="net" location="$ISE_LIBRARY\library\net\net-safe.ecf"/>
<library name="net_ssl" location="$ISE_LIBRARY\unstable\library\network\socket\netssl\net_ssl-safe.ecf"/>
<library name="httpd" location="..\..\lib\httpd\httpd-safe.ecf" readonly="false"/>
<library name="websocket_server" location="..\..\websocket_server-safe.ecf" readonly="false">
<option debug="true">
<debug name="ws" enabled="true"/>
Expand All @@ -29,8 +30,15 @@
<root class="APPLICATION" feature="make"/>
<setting name="concurrency" value="thread"/>
</target>
<target name="echo_websocket_server_mt_no_ssl" extends="echo_websocket_server_mt">
<variable name="httpd_ssl_disabled" value="true"/>
</target>

<target name="echo_websocket_server_scoop" extends="common">
<root class="APPLICATION" feature="make"/>
<setting name="concurrency" value="scoop"/>
</target>
<target name="echo_websocket_server_scoop_no_ssl" extends="echo_websocket_server_scoop">
<variable name="httpd_ssl_disabled" value="true"/>
</target>
</system>
29 changes: 21 additions & 8 deletions server/example/echo_websocket_server/echo_websocket_server.ecf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="echo_websocket_server" uuid="B1D3254D-A58E-4259-9796-8A2843A511A9">
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="echo_websocket_server" uuid="B1D3254D-A58E-4259-9796-8A2843A511A9">
<target name="common">
<file_rule>
<exclude>/.git$</exclude>
Expand All @@ -8,21 +8,34 @@
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" is_attached_by_default="true" void_safety="none">
<debug name="nino" enabled="true"/>
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="net" location="$ISE_LIBRARY\library\net\net.ecf"/>
<library name="net_ssl" location="$EIFFEL_LIBRARY\eiffel_net_openssl\net_ssl-safe.ecf"/>
<library name="websocket_server" location="..\..\websocket_server.ecf" readonly="false"/>

<library name="base" location="$ISE_LIBRARY\library\base\base.ecf">
<option>
<assertions precondition="true"/>
</option>
</library>
<library name="httpd" location="..\..\lib\httpd\httpd.ecf" readonly="false"/>
<library name="websocket_server" location="..\..\websocket_server.ecf" readonly="false">
<option debug="true">
<debug name="ws" enabled="true"/>
</option>
</library>
<cluster name="src" location=".\" recursive="true"/>
</target>
<target name="echo_websocket_server_threaded" extends="common">
<target name="echo_websocket_server_mt" extends="common">
<root class="APPLICATION" feature="make"/>
<setting name="concurrency" value="thread"/>
</target>
<target name="echo_websocket_server_mt_no_ssl" extends="echo_websocket_server_mt">
<variable name="httpd_ssl_disabled" value="true"/>
</target>

<target name="echo_websocket_server_scoop" extends="common">
<root class="APPLICATION" feature="make"/>
<setting name="concurrency" value="scoop"/>
</target>
<target name="echo_websocket_server_scoop_no_ssl" extends="echo_websocket_server_scoop">
<variable name="httpd_ssl_disabled" value="true"/>
</target>
</system>
18 changes: 0 additions & 18 deletions server/example/echo_websocket_server/shared_uri_contents_types.e

This file was deleted.

91 changes: 0 additions & 91 deletions server/example/echo_websocket_server/uri_contents_types.e

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ feature -- Access
Result := a_server.configuration.max_concurrent_connections
end

feature {HTTP_SERVER} -- Execution
feature {HTTP_SERVER_I} -- Execution

shutdown
do
Expand Down Expand Up @@ -113,7 +113,7 @@ feature {HTTP_SERVER} -- Execution
a_socket.cleanup
end

feature {HTTP_SERVER} -- Status report
feature {HTTP_SERVER_I} -- Status report

wait_for_completion
-- Wait until Current is ready for shutdown
Expand Down
Loading