mirror of
https://github.com/fluencelabs/js-libp2p-websockets
synced 2025-06-17 17:41:39 +00:00
feat: custom address filter (#116)
* feat: custom address filter BREAKING CHANGE: Only DNS+WSS addresses are now returned on filter by default in the browser. This can be overritten by the filter option and filters are provided in the module.
This commit is contained in:
@ -34,6 +34,16 @@ describe('libp2p-websockets', () => {
|
||||
expect(results).to.eql([message])
|
||||
})
|
||||
|
||||
it('should filter out no DNS websocket addresses', function () {
|
||||
const ma1 = multiaddr('/ip4/127.0.0.1/tcp/80/ws')
|
||||
const ma2 = multiaddr('/ip4/127.0.0.1/tcp/443/wss')
|
||||
const ma3 = multiaddr('/ip6/::1/tcp/80/ws')
|
||||
const ma4 = multiaddr('/ip6/::1/tcp/443/wss')
|
||||
|
||||
const valid = ws.filter([ma1, ma2, ma3, ma4])
|
||||
expect(valid.length).to.equal(0)
|
||||
})
|
||||
|
||||
describe('stress', () => {
|
||||
it('one big write', async () => {
|
||||
const rawMessage = new Uint8Array(1000000).fill('a')
|
||||
|
Reference in New Issue
Block a user