Skip to content

Commit df927e0

Browse files
committed
Merge pull request #1635 from uProxy/trevj-enable-obfuscation
enable basic obfuscation
2 parents 1bb0b1b + f062dc6 commit df927e0

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"lodash": "^3.7.0",
4747
"regex2dfa": "^0.1.6",
4848
"tsd": "^0.5.7",
49-
"uproxy-lib": "^27.2.2",
49+
"uproxy-lib": "^27.2.5",
5050
"utransformers": "^0.2.1",
5151
"xregexp": "^2.0.0"
5252
},

src/generic_core/globals.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export var STORAGE_VERSION = 1;
1313

1414
// 1: initial release
1515
// 2: uproxy-lib v27, move to bridge but no obfuscation yet
16-
export var MESSAGE_VERSION = 2;
16+
// 3: offer basicObfuscation
17+
export var MESSAGE_VERSION = 3;
1718

1819
export var DEFAULT_STUN_SERVERS = [
1920
{urls: ['stun:stun.l.google.com:19302']},

src/generic_core/remote-connection.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,17 @@ import tcp = require('../../../third_party/uproxy-lib/net/tcp');
213213
};
214214

215215
var pc: peerconnection.PeerConnection<Object>;
216-
if (remoteVersion < 2) {
216+
if (remoteVersion === 1) {
217217
log.debug('peer is running client version 1, using old peerconnection');
218218
pc = new peerconnection.PeerConnectionClass(
219219
freedom['core.rtcpeerconnection'](config),
220220
'sockstortc');
221-
} else {
222-
log.debug('peer is running client version >1, using bridge');
221+
} else if (remoteVersion === 2) {
222+
log.debug('peer is running client version 2, using bridge without obfuscation');
223223
pc = bridge.preObfuscation('sockstortc', config);
224+
} else {
225+
log.debug('peer is running client version >2, using bridge with basicObfuscation');
226+
pc = bridge.basicObfuscation('sockstortc', config);
224227
}
225228

226229
return this.socksToRtc_.start(tcpServer, pc).then(

0 commit comments

Comments
 (0)