const http2 = require('http2');
const SocksProxyAgent = require('socks-proxy-agent');

const proxy = 'socks4://10.10.10.10:1080'; // SOCKS4 proxy
const agent = new SocksProxyAgent(proxy);

const client = http2.connect('https://example.com', { agent });

client.on('error', (err) => console.error(err));

const req = client.request({ 'ath': '/' });

req.on('response', (headers) => {
console.log(headers);
});

req.end();