Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
5b8d5825
Commit
5b8d5825
authored
May 09, 2018
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(LogDB): added --logdb-httpserver-reply-addr
parent
dc8f9d33
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
libuniset2.spec
conf/libuniset2.spec
+2
-0
LogDB.cc
extensions/LogDB/LogDB.cc
+5
-2
LogDB.h
extensions/LogDB/LogDB.h
+1
-0
No files found.
conf/libuniset2.spec
View file @
5b8d5825
...
@@ -511,6 +511,8 @@ rm -f %buildroot%_libdir/*.la
...
@@ -511,6 +511,8 @@ rm -f %buildroot%_libdir/*.la
%changelog
%changelog
* Tue May 08 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt7
* Tue May 08 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt7
- (http): added support "CORS" (Access-Control-Allow-Origin)
- (http): added support "CORS" (Access-Control-Allow-Origin)
- (logdb): added --logdb-httpserver-reply-addr host:port
- minor fixes in LogSession
* Tue Apr 03 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt6
* Tue Apr 03 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt6
- new minor release
- new minor release
...
...
extensions/LogDB/LogDB.cc
View file @
5b8d5825
...
@@ -231,6 +231,8 @@ LogDB::LogDB( const string& name, int argc, const char* const* argv, const strin
...
@@ -231,6 +231,8 @@ LogDB::LogDB( const string& name, int argc, const char* const* argv, const strin
httpHost
=
uniset
::
getArgParam
(
"--"
+
prefix
+
"httpserver-host"
,
argc
,
argv
,
"localhost"
);
httpHost
=
uniset
::
getArgParam
(
"--"
+
prefix
+
"httpserver-host"
,
argc
,
argv
,
"localhost"
);
httpPort
=
uniset
::
getArgInt
(
"--"
+
prefix
+
"httpserver-port"
,
argc
,
argv
,
"8080"
);
httpPort
=
uniset
::
getArgInt
(
"--"
+
prefix
+
"httpserver-port"
,
argc
,
argv
,
"8080"
);
httpCORS_allow
=
uniset
::
getArgParam
(
"--"
+
prefix
+
"httpserver-cors-allow"
,
argc
,
argv
,
httpCORS_allow
);
httpCORS_allow
=
uniset
::
getArgParam
(
"--"
+
prefix
+
"httpserver-cors-allow"
,
argc
,
argv
,
httpCORS_allow
);
httpReplyAddr
=
uniset
::
getArgParam
(
"--"
+
prefix
+
"httpserver-reply-addr"
,
argc
,
argv
,
""
);
dblog1
<<
myname
<<
"(init): http server parameters "
<<
httpHost
<<
":"
<<
httpPort
<<
endl
;
dblog1
<<
myname
<<
"(init): http server parameters "
<<
httpHost
<<
":"
<<
httpPort
<<
endl
;
Poco
::
Net
::
SocketAddress
sa
(
httpHost
,
httpPort
);
Poco
::
Net
::
SocketAddress
sa
(
httpHost
,
httpPort
);
...
@@ -461,6 +463,7 @@ void LogDB::help_print()
...
@@ -461,6 +463,7 @@ void LogDB::help_print()
cout
<<
"--prefix-httpserver-max-queued num - Размер очереди запросов к http серверу. По умолчанию: 100"
<<
endl
;
cout
<<
"--prefix-httpserver-max-queued num - Размер очереди запросов к http серверу. По умолчанию: 100"
<<
endl
;
cout
<<
"--prefix-httpserver-max-threads num - Разрешённое количество потоков для http-сервера. По умолчанию: 3"
<<
endl
;
cout
<<
"--prefix-httpserver-max-threads num - Разрешённое количество потоков для http-сервера. По умолчанию: 3"
<<
endl
;
cout
<<
"--prefix-httpserver-cors-allow addr - (CORS): Access-Control-Allow-Origin. Default: *"
<<
endl
;
cout
<<
"--prefix-httpserver-cors-allow addr - (CORS): Access-Control-Allow-Origin. Default: *"
<<
endl
;
cout
<<
"--prefix-httpserver-reply-addr host[:port] - Адрес отдаваемый клиенту для подключения. По умолчанию адрес узла где запущен logdb"
<<
endl
;
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
LogDB
::
run
(
bool
async
)
void
LogDB
::
run
(
bool
async
)
...
@@ -1539,7 +1542,7 @@ void LogDB::httpWebSocketPage( std::ostream& ostr, Poco::Net::HTTPServerRequest&
...
@@ -1539,7 +1542,7 @@ void LogDB::httpWebSocketPage( std::ostream& ostr, Poco::Net::HTTPServerRequest&
for
(
const
auto
&
l
:
logservers
)
for
(
const
auto
&
l
:
logservers
)
{
{
ostr
<<
" <li><a target='_blank' href=
\"
http://"
ostr
<<
" <li><a target='_blank' href=
\"
http://"
<<
req
.
serverAddress
().
toString
(
)
<<
(
httpReplyAddr
.
empty
()
?
req
.
serverAddress
().
toString
()
:
httpReplyAddr
)
<<
"/logdb/ws/"
<<
l
->
name
<<
"
\"
>"
<<
"/logdb/ws/"
<<
l
->
name
<<
"
\"
>"
<<
l
->
name
<<
"</a> – "
<<
l
->
name
<<
"</a> – "
<<
"<i>"
<<
l
->
description
<<
"</i></li>"
<<
"<i>"
<<
l
->
description
<<
"</i></li>"
...
@@ -1588,7 +1591,7 @@ void LogDB::httpWebSocketConnectPage( ostream& ostr,
...
@@ -1588,7 +1591,7 @@ void LogDB::httpWebSocketConnectPage( ostream& ostr,
ostr
<<
" if (
\"
WebSocket
\"
in window)"
<<
endl
;
ostr
<<
" if (
\"
WebSocket
\"
in window)"
<<
endl
;
ostr
<<
" {"
<<
endl
;
ostr
<<
" {"
<<
endl
;
ostr
<<
" // LogScrollTimer = setInterval(LogAutoScroll,800);"
<<
endl
;
ostr
<<
" // LogScrollTimer = setInterval(LogAutoScroll,800);"
<<
endl
;
ostr
<<
" var ws = new WebSocket(
\"
ws://"
<<
req
.
serverAddress
().
toString
(
)
<<
"/logdb/ws/
\"
+ logname);"
<<
endl
;
ostr
<<
" var ws = new WebSocket(
\"
ws://"
<<
(
httpReplyAddr
.
empty
()
?
req
.
serverAddress
().
toString
()
:
httpReplyAddr
)
<<
"/logdb/ws/
\"
+ logname);"
<<
endl
;
ostr
<<
" var l = document.getElementById('logname');"
<<
endl
;
ostr
<<
" var l = document.getElementById('logname');"
<<
endl
;
ostr
<<
" l.innerHTML = logname"
<<
endl
;
ostr
<<
" l.innerHTML = logname"
<<
endl
;
ostr
<<
" ws.onmessage = function(evt)"
<<
endl
;
ostr
<<
" ws.onmessage = function(evt)"
<<
endl
;
...
...
extensions/LogDB/LogDB.h
View file @
5b8d5825
...
@@ -316,6 +316,7 @@ namespace uniset
...
@@ -316,6 +316,7 @@ namespace uniset
std
::
string
httpHost
=
{
""
};
std
::
string
httpHost
=
{
""
};
int
httpPort
=
{
0
};
int
httpPort
=
{
0
};
std
::
string
httpCORS_allow
=
{
"*"
};
std
::
string
httpCORS_allow
=
{
"*"
};
std
::
string
httpReplyAddr
=
{
""
};
double
wsHeartbeatTime_sec
=
{
3
.
0
};
double
wsHeartbeatTime_sec
=
{
3
.
0
};
double
wsSendTime_sec
=
{
0
.
5
};
double
wsSendTime_sec
=
{
0
.
5
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment