Commit Graph

69 Commits

Author SHA1 Message Date
Micooz
cf83eeebb4 utils,test: add uint64ToBuffer() 2018-04-26 13:48:13 +08:00
Micooz
26041f5659 utils,test: add incrementLE() and increamentBE() 2018-04-25 22:47:03 +08:00
Micooz
2f429de44a package: upgrade winston and winston-daily-rotate-file to v3.x, restrict log_path to be a file 2018-03-18 12:50:38 +08:00
Micooz
48d6e777dd *: reformat code 2018-02-17 12:19:31 +08:00
Micooz
cb6e3b5837 test: move src/utils/__tests__ to test/utils 2018-02-16 17:01:36 +08:00
Micooz
b785e20612 core,utils: move core/dns-cache.js to utils/, and refactor it 2018-02-05 14:23:26 +08:00
Micooz
e288d6fc40 utils/crypto: implement a faster version of randomBytes() 2018-01-18 18:02:11 +08:00
Micooz
c6a1b94e8d test: fix ci 2018-01-15 20:26:52 +08:00
Micooz
02cbc8771c utils: fix getRandomInt() 2018-01-15 20:23:58 +08:00
Micooz
f51806b348 utils: remove generateMutexId() 2018-01-15 20:22:50 +08:00
Micooz Lee
80a6e69653
Add multiplexing support (#94)
* core,presets,transports: add initial mux support

* core,presets: holy shit

* core,transports: fix fix

* core: some fix to multiplexer

* still not working, too complex

* transports: add mux

* core: pass "extraArgs" as the second parameter during piping

* src: first working version of mux

* core,presets: properly close sub connection from client

* core/multiplexer: fix stuck at the second connection

* core/multiplexer: split class into MuxClient and MuxServer

* core/multiplexer: pick a random mux relay to transfer encoded data on server side

* core,transports: remove "mux" transport and make mux on TLS work

* presets/tracker: only dump result when preset destroyed

* lint: fix

* core: bring preparePresets() to module scope

* transports/tcp: fix inbound destroy behaviour for mux

* utils: fix getRandomInt()

* core/multiplexer: fix getRandomMuxRelay()

* core/multiplexer: distinguish relay self-close and protocol(mux)-close

* test: add test for "mux"

* transports/websocket: prevent calling "on()" on null this._socket

* presets: add class IPresetAddressing

* core: wrap mux protocol inside custom protocol stack

* core: pass remoteInfo to new Relay() to correct remote address in log

* core: fix bugs and improve stability

* src: add/remove TODOs

* core/relay: store remoteInfo rather than context

* core/relay: fix a bug

* docs: update
2017-12-25 16:42:01 +08:00
Micooz
45893d2736
core,utils: (new Date()).getTime() -> Date.now() 2017-11-24 10:59:55 +08:00
Micooz
34575d6944 test: add test for dumpHex() 2017-10-31 22:52:53 +08:00
Micooz
2e1bc7748b utils: add dumpHex() 2017-10-31 22:46:53 +08:00
Micooz
116c1ff9de
utils: remove problematic parseURI() 2017-10-13 15:41:10 +08:00
Micooz
ef8ff9aa48 utils: add generateMutexId() 2017-10-08 11:21:19 +08:00
Micooz
6cf69805e7
utils: fixed a performance regression of advanced-buffer 2017-09-14 17:21:47 +08:00
Micooz
b4758e73ed
utils: add missing unit tests 2017-09-13 16:11:06 +08:00
Micooz
03e33a2b6b
utils: refactor shake128() 2017-09-13 15:10:31 +08:00
Micooz
14b1b02412 utils: more robust 2017-09-12 22:23:01 +08:00
Micooz
01e42411fb utils: split common into several modules 2017-09-12 22:23:01 +08:00
Micooz
4db9bbb3b9
utils: add clear() for AdvancedBuffer 2017-09-08 10:38:45 +08:00
Micooz
d86b8220f6
utils: fix isValidPort() 2017-09-05 09:52:43 +08:00
Micooz
2fc59687b1 utils: fix a type check bug in isValidPort() 2017-09-02 11:23:13 +08:00
Micooz
fff076711f
*: fix mode 2017-08-31 18:01:28 +08:00
Micooz
e4043ea1b2
utils: fix getRandomInt() 2017-08-29 11:35:54 +08:00
Micooz
d974c2b4d1
utils: improve performance of advanced-buffer 2017-08-29 10:50:32 +08:00
Micooz
1ffb7800de utils: refine logger config/import 2017-08-20 22:01:30 +08:00
Micooz
8a6657a688 utils: return default logger when instance is not available 2017-08-20 19:55:21 +08:00
Micooz
bf8450b0c5 core,utils: move logger to utils 2017-08-18 15:15:57 +08:00
Micooz
6aa4538fcb utils: add kebabCase() 2017-08-01 12:47:53 +08:00
Micooz
4e9c356ef3 test: add tests for utils.Xor() 2017-08-01 10:32:15 +08:00
Micooz
be41c47dae utils: add Xor() 2017-08-01 09:53:44 +08:00
Micooz
32de693385 utils: change md5(buffer) to hash(algorithm, buffer) 2017-07-23 22:58:05 +08:00
Micooz
fffca228e7 refactor(utils): bring blinksocks-utils back to blinksocks 2017-06-11 22:55:46 +08:00
Micooz
a333eb1408 refactor(utils): use "blinksocks-utils" package instead 2017-04-23 19:47:05 +08:00
Micooz
48c4f6cc04 test(utils): update 2017-04-22 16:31:23 +08:00
Micooz
407cc446f6 chore(utils): rename stringToBuffer -> hexStringToBuffer 2017-04-22 16:18:33 +08:00
Micooz
330a137052 refactor(utils): getRandomInt now generates cryptographically strong pseudo-random integer 2017-04-22 16:17:42 +08:00
Micooz
de56e2f96d refactor(presets): extract "getUTC", "stb", "hmac" and "HKDF" to utils.js 2017-04-22 14:10:58 +08:00
Micooz
df1a705b73 refactor(utils): extract getChunks() into utils.js, add getRandomChunks() 2017-04-21 17:28:36 +08:00
Micooz
f8c6c275b6 refactor(core): now multiple servers can have different configurations
close: #48
2017-04-15 17:01:34 +08:00
Micooz
89932067d0 feat(presets): verify DST.ADDR of presets/ss-base
close: #47
2017-04-14 15:10:33 +08:00
Micooz
37687cfb36 test(utils): update 2017-04-07 15:56:21 +08:00
Micooz
d9d3b57872 refactor(utils): extract md5() and EVP_BytesToKey() to utils.js 2017-04-07 15:19:41 +08:00
Micooz
15a47ce39a chore(utils): add isValidPort() function 2017-03-29 16:17:39 +08:00
Micooz
48259c3952 refactor(advanced-buffer): prevent redundant calling to getPacketLength() and improve performance 2017-03-28 12:41:52 +08:00
Micooz
c15db1031c test(advanced-buffer): update 2017-03-27 22:11:03 +08:00
Micooz
b0bc062886 chore(utils): combine numberToUIntBE and numberToUIntLE to numberToUInt 2017-03-27 22:10:36 +08:00
Micooz
5fa5380fe1 feat(advanced-buffer): allow to pass extra arguments to put() 2017-03-27 17:32:17 +08:00