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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
libuniset2.spec
conf/libuniset2.spec
+2
-0
LogDB.cc
extensions/LogDB/LogDB.cc
+10
-7
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
%changelog
* Tue May 08 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt7
- (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
- 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
httpHost
=
uniset
::
getArgParam
(
"--"
+
prefix
+
"httpserver-host"
,
argc
,
argv
,
"localhost"
);
httpPort
=
uniset
::
getArgInt
(
"--"
+
prefix
+
"httpserver-port"
,
argc
,
argv
,
"8080"
);
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
;
Poco
::
Net
::
SocketAddress
sa
(
httpHost
,
httpPort
);
...
...
@@ -456,11 +458,12 @@ void LogDB::help_print()
cout
<<
"--prefix-ls-read-buffer-size num - Размер буфера для чтения сообщений от логсервера. По умолчанию: 10001"
<<
endl
;
cout
<<
"http: "
<<
endl
;
cout
<<
"--prefix-httpserver-host ip - IP на котором слушает http сервер. По умолчанию: localhost"
<<
endl
;
cout
<<
"--prefix-httpserver-port num - Порт на котором принимать запросы. По умолчанию: 8080"
<<
endl
;
cout
<<
"--prefix-httpserver-max-queued num - Размер очереди запросов к http серверу. По умолчанию: 100"
<<
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-host ip - IP на котором слушает http сервер. По умолчанию: localhost"
<<
endl
;
cout
<<
"--prefix-httpserver-port num - Порт на котором принимать запросы. По умолчанию: 8080"
<<
endl
;
cout
<<
"--prefix-httpserver-max-queued num - Размер очереди запросов к http серверу. По умолчанию: 100"
<<
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-reply-addr host[:port] - Адрес отдаваемый клиенту для подключения. По умолчанию адрес узла где запущен logdb"
<<
endl
;
}
// -----------------------------------------------------------------------------
void
LogDB
::
run
(
bool
async
)
...
...
@@ -1539,7 +1542,7 @@ void LogDB::httpWebSocketPage( std::ostream& ostr, Poco::Net::HTTPServerRequest&
for
(
const
auto
&
l
:
logservers
)
{
ostr
<<
" <li><a target='_blank' href=
\"
http://"
<<
req
.
serverAddress
().
toString
(
)
<<
(
httpReplyAddr
.
empty
()
?
req
.
serverAddress
().
toString
()
:
httpReplyAddr
)
<<
"/logdb/ws/"
<<
l
->
name
<<
"
\"
>"
<<
l
->
name
<<
"</a> – "
<<
"<i>"
<<
l
->
description
<<
"</i></li>"
...
...
@@ -1588,7 +1591,7 @@ void LogDB::httpWebSocketConnectPage( ostream& ostr,
ostr
<<
" if (
\"
WebSocket
\"
in window)"
<<
endl
;
ostr
<<
" {"
<<
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
<<
" l.innerHTML = logname"
<<
endl
;
ostr
<<
" ws.onmessage = function(evt)"
<<
endl
;
...
...
extensions/LogDB/LogDB.h
View file @
5b8d5825
...
...
@@ -316,6 +316,7 @@ namespace uniset
std
::
string
httpHost
=
{
""
};
int
httpPort
=
{
0
};
std
::
string
httpCORS_allow
=
{
"*"
};
std
::
string
httpReplyAddr
=
{
""
};
double
wsHeartbeatTime_sec
=
{
3
.
0
};
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