Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vernemq
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
stack
vernemq
Commits
0e3f256a
Commit
0e3f256a
authored
Sep 17, 2018
by
Chavee Issariyapat
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'alpha-test' of
https://dev.nexpie.com/stack/vernemq
into alpha-test
parents
98aeda43
9547c678
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
authhook/on_delivery.js
+1
-1
authhook/utils/getTopic.js
+11
-2
files/vernemq.conf
+3
-0
No files found.
authhook/on_delivery.js
View file @
0e3f256a
...
...
@@ -3,7 +3,7 @@ function on_delivery(req, res, next) {
var
response
=
{
'result'
:
'ok'
,
'modifiers'
:
{
"topic"
:
topics
"topic"
:
topics
}
}
res
.
send
(
response
)
...
...
authhook/utils/getTopic.js
View file @
0e3f256a
function
getTopic
(
topic
,
id
)
{
var
_topic
=
classifiedTopic
(
topic
)
+
'/!'
+
id
+
topic
.
split
(
classifiedTopic
(
topic
))[
1
]
return
_topic
if
(
!
checkWildCard
(
topic
))
{
var
_topic
=
classifiedTopic
(
topic
)
+
'/!'
+
id
+
topic
.
split
(
classifiedTopic
(
topic
))[
1
]
return
_topic
}
else
return
topic
}
module
.
exports
.
getTopic
=
getTopic
...
...
@@ -16,4 +19,9 @@ function classifiedTopic(topic) {
}
else
if
(
topic
.
indexOf
(
'@client'
)
!==
-
1
)
{
return
'@client'
}
}
function
checkWildCard
(
topic
)
{
if
(
topic
.
indexOf
(
'#'
)
>
-
1
)
return
true
else
return
false
}
\ No newline at end of file
files/vernemq.conf
View file @
0e3f256a
...
...
@@ -814,6 +814,9 @@ vmq_webhooks.webhook3.endpoint = http://localhost:40000/authpub
vmq_webhooks
.
webhook4
.
hook
=
on_publish
vmq_webhooks
.
webhook4
.
endpoint
=
http
://
localhost
:
41000
/
onpub
vmq_webhooks
.
webhook5
.
hook
=
on_delivery
vmq_webhooks
.
webhook5
.
endpoint
=
http
://
localhost
:
40000
/
ondelivery
## Specify the address and port of the bridge to connect to. Several
## bridges can configured by using different bridge names (e.g. br0). If the
## connection supports SSL encryption bridge.ssl.<name> can be used.
...
...
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