Skip to content

how do i set local ip address #91

Answered by qgustavor
DnzByhn asked this question in Q&A
Discussion options

You must be logged in to vote

I'm assuming you are changing network settings outside the library. In order to change network settings related to the library follow the documentation: https://mega.js.org/docs/tutorial/network-settings

In order to to set the local interface you need to use an agent as described in this node-fetch issue. To set up this agent in the library you, following the above documentation, just need to pass the agent to the Storage constructor or replace it in the global agent:

import { Agent as HttpAgent } from 'http'
import { Agent as HttpsAgent } from 'https'
import { API, Storage } from 'megajs'

const httpAgent = new HttpAgent({ keepAlive: true, localAddress: '10.1.1.2' })
const httpsAgent = new 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DnzByhn
Comment options

Answer selected by qgustavor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #90 on March 05, 2022 15:17.