Commit Graph

174 Commits

Author SHA1 Message Date
Cas
c99eb89208
fix: drop buffer (#465) 2023-05-26 17:54:30 +01:00
renovate[bot]
2209d4f21b
fix(deps): update dependency ws to v8 (#448)
* fix(deps): update dependency ws to v8

* fix: ws imports (#449)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cas <6506529+ThaUnknown@users.noreply.github.com>
2023-02-01 15:19:06 +01:00
renovate[bot]
b72d226ed8
chore(deps): update webtorrent (#445)
* chore(deps): update webtorrent

* fix: dependencies (#446)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cas <6506529+ThaUnknown@users.noreply.github.com>
2023-02-01 03:43:44 +01:00
Cas
e6d3189edf
feat: esm (#431)
BREAKING CHANGE: ESM only

* feat: esm

* fix: linter oops
2022-12-05 23:06:54 +01:00
Diego Rodríguez Baquero
ca88435617
fix: if websocket closed, don't produce a response 2021-07-21 20:07:06 -05:00
Diego Rodriguez Baquero
e5994d2ebd
fix: modernize 2021-06-14 20:54:41 -05:00
Feross Aboukhadijeh
69976e80d7 give user a friendlier error when address() is unavailable due to noServer 2021-01-28 15:16:53 -05:00
John Hiesey
db1b63dec9 Support ws noServer option and server option objects 2021-01-27 19:27:39 -08:00
Diego Rodríguez Baquero
587b6e6395
fix standard 2020-03-29 12:51:49 -05:00
Diego Rodríguez Baquero
8b8daa3d4a
fix: set correct headers 2020-03-29 12:32:31 -05:00
Feross Aboukhadijeh
d6751dac41 remove safe-buffer 2019-08-06 17:58:05 -07:00
Feross Aboukhadijeh
b88cdf7d0a standard 2019-07-27 20:35:35 -07:00
Feross Aboukhadijeh
db4a06d97f standard 2019-07-05 13:12:24 -07:00
Justin Kalland
dc79834f77 Use blocks with brackets 2018-12-20 12:59:53 -07:00
Justin Kalland
bc861ef10a Revert "Remove declarations from inside switch statements"
This reverts commit d1b9047c03.
2018-12-20 12:52:05 -07:00
Justin Kalland
d1b9047c03 Remove declarations from inside switch statements 2018-12-20 12:36:54 -07:00
Jimmy Wärting
1e8487038f removed some more self variables 2018-10-03 11:49:45 +02:00
Jimmy Wärting
7df1bdfa3f few es6 sugar 2018-10-02 18:37:46 +02:00
Jimmy Wärting
502b11fb9e EventEmitter is circular 2018-10-02 18:33:30 +02:00
Jimmy Wärting
ecf91b6f1b removed self 2018-10-02 18:33:00 +02:00
Jimmy Wärting
02032d0536 lebab sever.js 2018-10-02 18:26:35 +02:00
Feross Aboukhadijeh
afcb6df085
standard 2018-04-29 21:20:51 -07:00
Feross Aboukhadijeh
65c02dd153
server: Improve style of announce/filter logic
- Filter before potentially creating a swarm that is not needed
- Unify getSwarm()/createSwarm() into a getOrCreateSwarm() function
2018-04-29 21:17:57 -07:00
daiyu
2ba6946f17 standard 2018-04-24 13:12:34 +08:00
daiyu
5ad210b7e1 Fix filter function 2018-04-23 23:09:57 +08:00
James M Snell
fcf28cbd46
Replace new Buffer with Buffer.from
Code is already using safe-buffer, just replace the constructor API
2018-03-21 16:31:30 -07:00
Feross Aboukhadijeh
fc87c8c9ff build 2018-02-17 17:13:56 -08:00
Feross Aboukhadijeh
8c28f025b4 Fixes for ws@3 2017-06-23 15:51:27 -07:00
Feross Aboukhadijeh
992cd77fc7 expose Swarm object for easy overriding 2017-03-10 13:38:43 -08:00
Feross Aboukhadijeh
ee9ebc506c remove requestHandler option 2017-03-10 13:38:27 -08:00
Yoann Ciabaud
146d4d46dd Extension point on requests and responses 2017-03-09 11:19:46 +01:00
Feross Aboukhadijeh
40202a00b7 BREAKING: change how the filter function works
It's non-standard for a callback function to take a non-error argument
in the first position.

So instead of the filter callback accepting three types of arguments:

cb(true) // allowed
cb(false) // disallowed
cb(new Error('custom message')) // disallowed with custom message

It now accepts two forms:

cb(new Error('custom message')) // disallowed with custom message
cb(null) // allowed
2017-03-01 22:54:40 -08:00
Feross Aboukhadijeh
ccb50a7ee9 add one missing self.destroyed check 2017-02-21 01:51:08 -08:00
Feross Aboukhadijeh
b2c2b8f0d0 do not access socket.infoHashes if socket is destroyed 2017-02-21 01:50:30 -08:00
Feross Aboukhadijeh
a469740603 Merge pull request #198 from feross/fix-196
Fix stats and leaked websockets
2017-02-09 23:16:28 +01:00
Diego Rodríguez Baquero
7fea1964af Update server.js 2017-02-08 16:53:50 -05:00
Diego Rodríguez Baquero
a1ee19d59a Set ws server clientTracking to false
https://github.com/feross/bittorrent-tracker/pull/200#issuecomment-278450630
2017-02-08 16:47:54 -05:00
Feross Aboukhadijeh
d534582a8c Only close websocket when it's not participating in any more swarms 2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
6351f2b260 style: re-order methods 2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
71bd413980 perf: disable perMessageDeflate
From the ws docs:

"ws supports the permessage-deflate extension extension which enables
the client and server to negotiate a compression algorithm and its
parameters, and then selectively apply it to the data payloads of each
WebSocket message.

The extension is enabled by default but adds a significant overhead in
terms of performance and memory comsumption. We suggest to use
WebSocket compression only if it is really needed.

To disable the extension you can set the perMessageDeflate option to
false"
2017-02-07 23:00:10 -08:00
Feross Aboukhadijeh
fb751d7c96 Re-enable ws server tests (websocket tracker) 2017-01-29 16:25:16 -08:00
Feross Aboukhadijeh
9cf2dffa67 debug: better debug names 2017-01-20 18:34:33 -08:00
Feross Aboukhadijeh
f2786cde96 Fixes for PR #170 2016-08-09 21:39:30 -07:00
Alex
ebf117242c Check if peer is undefined 2016-08-09 13:30:40 +02:00
Yoann Ciabaud
f76b27c12a Merge pull request #160 from yciabaud/lru-pruning
Limit peers in tracker server with LRU based cache fixes #4
2016-07-19 19:50:25 +02:00
Yoann Ciabaud
2ac65725a1 Merge pull request #158 from yciabaud/stats-clients
Add stats on clients based on peerIds
2016-06-23 15:08:23 +02:00
Yoann Ciabaud
29fcf30cb4 Use correct HTTP header to work with JSON on GET 2016-06-13 00:34:26 +02:00
Yoann Ciabaud
d51a77b028 Update lru package to 3.0.0 and set peersCacheLength to 1K as default 2016-06-10 10:00:19 +02:00
Yoann Ciabaud
ca522c0c4b Prune old peers in server with lru based cache. Issue #4 2016-06-08 23:57:01 +02:00
Yoann Ciabaud
f8c7de5213 Add stats on clients based on peerIds 2016-06-07 14:34:38 +02:00