Coder Social home page Coder Social logo

How to use proxy? thanks about phantomjs HOT 3 CLOSED

benbjohnson avatar benbjohnson commented on June 14, 2024 3
How to use proxy? thanks

from phantomjs.

Comments (3)

MikhailKlemin avatar MikhailKlemin commented on June 14, 2024

I thought about this as well.
It is not implemented in the package, but it seems like posisble just to add a cmd.Env for "http_proxy" however I have not tested it.
From phantomjs.go:

// Start external process.
cmd := exec.Command(p.BinPath, scriptPath)
cmd.Env = []string{fmt.Sprintf("PORT=%d", p.Port)}

So just change to

// Start external process.
cmd := exec.Command(p.BinPath, scriptPath)
cmd.Env = []string{fmt.Sprintf("PORT=%d", p.Port), "http_proxy=192.168.1.4:8000", "HTTPS_PROXY=192.168.1.4:8000"}

Or just implement phantomjs --proxy in the code.

from phantomjs.

ego008 avatar ego008 commented on June 14, 2024

I have added some setProxy functions in my fork https://github.com/ego008/gophantomjs

from phantomjs.

benbjohnson avatar benbjohnson commented on June 14, 2024

I'm closing this issue and archiving the repository as phantomjs has been deprecated since 2018. https://github.com/benbjohnson/phantomjs#deprecation-warning

from phantomjs.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.