Code Monkey home page Code Monkey logo

Comments (7)

MihaZupan avatar MihaZupan commented on September 13, 2024

Are you creating a new instance of HttpToSocks5Proxy for every request?

from httptosocks5proxy.

Bouki6 avatar Bouki6 commented on September 13, 2024

Yes.
just like traditional WebProxy every time i created new one. is it wrong?

from httptosocks5proxy.

MihaZupan avatar MihaZupan commented on September 13, 2024

The HttpToSocks5Proxy instance is meant to be reused, or explicitly shut down by calling StopInternalServer. If you create a new one for each request you are essentially starting a new server that never stops, eventually running out of ports.

I will update the usage examples to make this clear.

from httptosocks5proxy.

Bouki6 avatar Bouki6 commented on September 13, 2024

thank you dear @MihaZupan for your great work.
so if i create a single HttpToSocks5Proxy instance(for example make it static) and use it all over my application, problem solves? I have more than 1000 proxies in my application.

from httptosocks5proxy.

MihaZupan avatar MihaZupan commented on September 13, 2024

If you are using the same proxy server for all requests, making it static is a good choice. If you are using different proxy servers then you should create a HttpToSocks5Proxy instance for each proxy server.

from httptosocks5proxy.

Bouki6 avatar Bouki6 commented on September 13, 2024

yes exactly. i will create static list of proxies. then reuse all over the code.

from httptosocks5proxy.

MihaZupan avatar MihaZupan commented on September 13, 2024

Great!

If you are making very few requests (i.e. less than 10/h per proxy), you can also create a new instance every time and call StopInternalServer.

from httptosocks5proxy.

Related Issues (16)

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.