Skip to content

Support agents set up #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions examples/Proxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const TradingView = require('../main')

/*
Test Proxy
*/

if (!process.argv[2]) throw Error('Please specify your \'sessionid\' cookie')
if (!process.argv[3]) throw Error('Please specify proxy')

TradingView.SetAgent(process.argv[3])

TradingView.getPrivateIndicators(process.argv[2]).then((indicList) => {
indicList.forEach(async (indic) => {
console.log('Loading indicator', indic.name, '...')
})
})
22 changes: 12 additions & 10 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const miscRequests = require('./src/miscRequests');
const Client = require('./src/client');
const BuiltInIndicator = require('./src/classes/BuiltInIndicator');
const PineIndicator = require('./src/classes/PineIndicator');
const PinePermManager = require('./src/classes/PinePermManager');
const miscRequests = require('./src/miscRequests')
const Client = require('./src/client')
const BuiltInIndicator = require('./src/classes/BuiltInIndicator')
const PineIndicator = require('./src/classes/PineIndicator')
const PinePermManager = require('./src/classes/PinePermManager')
const { setAgent } = require('./src/proxy')

module.exports = { ...miscRequests };
module.exports.Client = Client;
module.exports.BuiltInIndicator = BuiltInIndicator;
module.exports.PineIndicator = PineIndicator;
module.exports.PinePermManager = PinePermManager;
module.exports = { ...miscRequests }
module.exports.Client = Client
module.exports.BuiltInIndicator = BuiltInIndicator
module.exports.PineIndicator = PineIndicator
module.exports.PinePermManager = PinePermManager
module.exports.SetAgent = setAgent
135 changes: 121 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"author": "Mathieu Colmon",
"license": "ISC",
"dependencies": {
"https-proxy-agent": "^7.0.0",
"jszip": "^3.7.1",
"socks-proxy-agent": "^8.0.1",
"ws": "^7.4.3"
},
"devDependencies": {
Expand Down
Loading