Skip to content

Commit

Permalink
Switch from hostname to username for local tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejearley committed Sep 20, 2022
1 parent 569dac7 commit 0b5fdc5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contracts/evm/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ const config: HardhatUserConfig = {
}

// Start a local tunnel for using RPC with https
const localSubdomain = `cn-hh-${os.hostname().toLowerCase()}`
const localSubdomain = `cn-hh-${os.userInfo().username.toLowerCase()}`
const localUrl = `https://${localSubdomain}.loca.lt`
console.log('Your local tunnel is', localUrl)
localtunnel({ port: 8545, subdomain: localSubdomain }).then((tunnel: localtunnel.Tunnel) => {
console.log(`Your https tunnel is ${ localUrl === tunnel.url ? 'now available' : 'not available'}`)
if (localUrl === tunnel.url) {
console.log('Your local tunnel is now available at', localUrl)
} else {
console.log('Your desired local tunnel url is not available')
}
process.on('SIGINT', () => {
tunnel.close()
process.exit(0)
Expand Down

0 comments on commit 0b5fdc5

Please sign in to comment.