1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 02:09:32 +02:00

Reverse port forwarding backend actually works now. UI needs some work for the "new vision".

This commit is contained in:
Simo Kinnunen 2014-10-09 18:34:13 +09:00
parent d55ccebdc5
commit 617e20522b
10 changed files with 395 additions and 195 deletions

View file

@ -676,32 +676,26 @@ module.exports = function(options) {
if (!data.targetHost || data.targetHost === 'localhost') {
data.targetHost = socket.request.ip
}
dbapi.addUserForward(user.email, data)
.then(function() {
socket.emit('forward.create', data)
joinChannel(responseChannel)
push.send([
channel
, wireutil.transaction(
responseChannel
, new wire.ForwardCreateMessage(data)
)
])
})
socket.emit('forward.create', data)
joinChannel(responseChannel)
push.send([
channel
, wireutil.transaction(
responseChannel
, new wire.ForwardCreateMessage(data)
)
])
})
.on('forward.remove', function(channel, responseChannel, data) {
dbapi.removeUserForward(user.email, data.devicePort)
.then(function() {
socket.emit('forward.remove', data)
joinChannel(responseChannel)
push.send([
channel
, wireutil.transaction(
responseChannel
, new wire.ForwardRemoveMessage(data)
)
])
})
socket.emit('forward.remove', data)
joinChannel(responseChannel)
push.send([
channel
, wireutil.transaction(
responseChannel
, new wire.ForwardRemoveMessage(data)
)
])
})
.on('logcat.start', function(channel, responseChannel, data) {
joinChannel(responseChannel)