chore: enabile back filterAll if set by consumer (#2103)

This commit is contained in:
Sasha 2024-08-22 15:55:29 +02:00 committed by GitHub
parent 409642d7d3
commit 2beb359cef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -30,4 +30,9 @@ export type CreateLibp2pOptions = Libp2pOptions & {
*/
hideWebSocketInfo?: boolean;
pingMaxInboundStreams?: number;
/**
* Applies secure web socket filters.
* @default true
*/
filterMultiaddrs?: boolean;
};

View File

@ -64,13 +64,16 @@ export async function defaultLibp2p(
? { metadata: wakuMetadata(pubsubTopics) }
: {};
const filter = process?.env?.NODE_ENV === "test" ? filterAll : wss;
const filter =
options?.filterMultiaddrs === false || process?.env?.NODE_ENV === "test"
? filterAll
: wss;
return createLibp2p({
connectionManager: {
minConnections: 1
},
transports: [webSockets({ filter })],
transports: [webSockets({ filter: filter })],
streamMuxers: [mplex()],
connectionEncryption: [noise()],
...options,