Skip to content

Commit

Permalink
new way to enable proxy support
Browse files Browse the repository at this point in the history
  • Loading branch information
victoryeo committed Oct 1, 2023
1 parent 82e18a3 commit ac189c8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ const getUrl = async (req, _signal) => {

//FetchRequest.registerGetUrl(getUrl);

const fetchReq = new FetchRequest(ETH_RPC);
fetchReq.agent = new HttpsProxyAgent(HTTP_PROXY);
const provider = new JsonRpcProvider(fetchReq);
provider.getBlockNumber().then(console.log)

const app = express();
const port = 3000;

Expand Down

0 comments on commit ac189c8

Please sign in to comment.