-
Notifications
You must be signed in to change notification settings - Fork 3
Splitted ws server from httpd (i.e concurrent nino) and allow to disable ssl support at compilation time. #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
889905a
5e91955
8a56b05
3a50fb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ deferred class | |
|
|
||
| inherit | ||
|
|
||
| WEB_SOCKET_CONSTANTS | ||
| WS_CONSTANTS | ||
|
|
||
| feature -- Access | ||
|
|
||
|
|
||
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ note | |
| revision: "$Revision$" | ||
|
|
||
| class | ||
| WEB_SOCKET_CONSTANTS | ||
| WS_CONSTANTS | ||
|
|
||
| feature -- Constants | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ class | |
| inherit | ||
| ANY | ||
|
|
||
| WEB_SOCKET_CONSTANTS | ||
| WS_CONSTANTS | ||
|
|
||
| create | ||
| make, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And to be able to use in on Unix...
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in fact, I think we could provide simple ca.* file .. for "localhost" 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:
|
||
| 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") | ||
|
|
||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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