mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:23:25 +02:00
Reverse port forwarding works, but changes don't apply to new devices yet.
This commit is contained in:
@@ -169,6 +169,26 @@ module.exports = function ControlServiceFactory(
|
||||
rotation: rotation
|
||||
})
|
||||
}
|
||||
|
||||
this.testForward = function(forward) {
|
||||
var tx = TransactionService.create(target)
|
||||
socket.emit('forward.test', channel, tx.channel, forward)
|
||||
return tx
|
||||
}
|
||||
|
||||
this.createForward = function(forward) {
|
||||
var tx = TransactionService.create(target)
|
||||
socket.emit('forward.create', channel, tx.channel, forward)
|
||||
return tx
|
||||
}
|
||||
|
||||
this.removeForward = function(forward) {
|
||||
var tx = TransactionService.create(target)
|
||||
socket.emit('forward.remove', channel, tx.channel, {
|
||||
devicePort: forward.devicePort
|
||||
})
|
||||
return tx
|
||||
}
|
||||
}
|
||||
|
||||
controlService.create = function(target, channel) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var io = require('socket.io')
|
||||
|
||||
module.exports = function SocketFactory() {
|
||||
module.exports = function SocketFactory($rootScope) {
|
||||
var socket = io.connect(null, {
|
||||
reconnect: false
|
||||
})
|
||||
@@ -26,5 +26,11 @@ module.exports = function SocketFactory() {
|
||||
}
|
||||
}
|
||||
|
||||
socket.on('socket.ip', function(ip) {
|
||||
$rootScope.$apply(function() {
|
||||
socket.ip = ip
|
||||
})
|
||||
})
|
||||
|
||||
return socket
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user