Skip to content

Commit

Permalink
updates ws calls to only use helius endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
walt-1 committed Feb 22, 2024
1 parent 9fa8e1d commit b0a9914
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export default {

const upgradeHeader = request.headers.get('Upgrade');
if (upgradeHeader || upgradeHeader === 'websocket') {
return await fetch(RPC_POOL[curSegment - 1], request);
const wsIndex = RPC_POOL.findIndex(i => i.includes('helius'))
return await fetch(RPC_POOL[wsIndex !== -1 ? wsIndex : curSegment - 1], request);
}

const payload = await request.text();
Expand Down

0 comments on commit b0a9914

Please sign in to comment.