force node.exe to go throw proxifier on windows 10












1















I am developing bots for telegram, I am from Iran and telegram url is blocked in my country and I am forced to use VPN/Proxy servers to access telegram api from my local dev machine.



But I have other apps running on my system that won't work throw a VPN, So I am forced to use proxifier, I can define rules for the apps that I need to go throw a proxy.



But node.exe is ignoring this rules for some reason, I can see in NetLimiter that the connection is coming from C:Program Files (x86)nodejsnode.exe, But adding this path to proxifier's rules has no effect, other apps like telegram itself and firefox and ... works fine with these rules ...



So has anyone managed to force node.exe to go throw proxifier?



I also tried to setup a proxcy with php in my host, but none of the proxy scripts I found was able to handle the file uploads



My last hope is to install some modules for apache and use it as a proxy or just install nginx ...



I also tried https://github.com/krisives/proxysocket and https://github.com/TooTallNate/node-https-proxy-agent with no success, its just keeps throwing errors :(










share|improve this question





























    1















    I am developing bots for telegram, I am from Iran and telegram url is blocked in my country and I am forced to use VPN/Proxy servers to access telegram api from my local dev machine.



    But I have other apps running on my system that won't work throw a VPN, So I am forced to use proxifier, I can define rules for the apps that I need to go throw a proxy.



    But node.exe is ignoring this rules for some reason, I can see in NetLimiter that the connection is coming from C:Program Files (x86)nodejsnode.exe, But adding this path to proxifier's rules has no effect, other apps like telegram itself and firefox and ... works fine with these rules ...



    So has anyone managed to force node.exe to go throw proxifier?



    I also tried to setup a proxcy with php in my host, but none of the proxy scripts I found was able to handle the file uploads



    My last hope is to install some modules for apache and use it as a proxy or just install nginx ...



    I also tried https://github.com/krisives/proxysocket and https://github.com/TooTallNate/node-https-proxy-agent with no success, its just keeps throwing errors :(










    share|improve this question



























      1












      1








      1








      I am developing bots for telegram, I am from Iran and telegram url is blocked in my country and I am forced to use VPN/Proxy servers to access telegram api from my local dev machine.



      But I have other apps running on my system that won't work throw a VPN, So I am forced to use proxifier, I can define rules for the apps that I need to go throw a proxy.



      But node.exe is ignoring this rules for some reason, I can see in NetLimiter that the connection is coming from C:Program Files (x86)nodejsnode.exe, But adding this path to proxifier's rules has no effect, other apps like telegram itself and firefox and ... works fine with these rules ...



      So has anyone managed to force node.exe to go throw proxifier?



      I also tried to setup a proxcy with php in my host, but none of the proxy scripts I found was able to handle the file uploads



      My last hope is to install some modules for apache and use it as a proxy or just install nginx ...



      I also tried https://github.com/krisives/proxysocket and https://github.com/TooTallNate/node-https-proxy-agent with no success, its just keeps throwing errors :(










      share|improve this question
















      I am developing bots for telegram, I am from Iran and telegram url is blocked in my country and I am forced to use VPN/Proxy servers to access telegram api from my local dev machine.



      But I have other apps running on my system that won't work throw a VPN, So I am forced to use proxifier, I can define rules for the apps that I need to go throw a proxy.



      But node.exe is ignoring this rules for some reason, I can see in NetLimiter that the connection is coming from C:Program Files (x86)nodejsnode.exe, But adding this path to proxifier's rules has no effect, other apps like telegram itself and firefox and ... works fine with these rules ...



      So has anyone managed to force node.exe to go throw proxifier?



      I also tried to setup a proxcy with php in my host, but none of the proxy scripts I found was able to handle the file uploads



      My last hope is to install some modules for apache and use it as a proxy or just install nginx ...



      I also tried https://github.com/krisives/proxysocket and https://github.com/TooTallNate/node-https-proxy-agent with no success, its just keeps throwing errors :(







      node.js windows proxy telegram vpn






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 9:41







      Exlord

















      asked Nov 20 '18 at 8:19









      ExlordExlord

      3,11921935




      3,11921935
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Ok, after hours of trying finally got this to work with proxifier.



          https://github.com/TooTallNate/node-https-proxy-agent



          new HttpsProxyAgent('http://username:password@127.0.0.1:8080')





          Update :
          This approach had its problems so I created a small personal proxy server with node-http-proxy on my server and connected to it:



          process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

          const debug = require('debug')('app');
          const http = require('http');
          const httpProxy = require('http-proxy');

          const proxy = httpProxy.createProxyServer({
          secure : false
          });
          proxy.on('error', function (e) {
          debug(e);
          });

          const server = http.createServer(function(req, res) {
          // You can define here your custom logic to handle the request
          // and then proxy the request.
          proxy.web(req, res, { target: 'https://api.telegram.org', });
          });

          server.listen(3333);


          And simply just redirected all the request to this server.






          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53388801%2fforce-node-exe-to-go-throw-proxifier-on-windows-10%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Ok, after hours of trying finally got this to work with proxifier.



            https://github.com/TooTallNate/node-https-proxy-agent



            new HttpsProxyAgent('http://username:password@127.0.0.1:8080')





            Update :
            This approach had its problems so I created a small personal proxy server with node-http-proxy on my server and connected to it:



            process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

            const debug = require('debug')('app');
            const http = require('http');
            const httpProxy = require('http-proxy');

            const proxy = httpProxy.createProxyServer({
            secure : false
            });
            proxy.on('error', function (e) {
            debug(e);
            });

            const server = http.createServer(function(req, res) {
            // You can define here your custom logic to handle the request
            // and then proxy the request.
            proxy.web(req, res, { target: 'https://api.telegram.org', });
            });

            server.listen(3333);


            And simply just redirected all the request to this server.






            share|improve this answer






























              1














              Ok, after hours of trying finally got this to work with proxifier.



              https://github.com/TooTallNate/node-https-proxy-agent



              new HttpsProxyAgent('http://username:password@127.0.0.1:8080')





              Update :
              This approach had its problems so I created a small personal proxy server with node-http-proxy on my server and connected to it:



              process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

              const debug = require('debug')('app');
              const http = require('http');
              const httpProxy = require('http-proxy');

              const proxy = httpProxy.createProxyServer({
              secure : false
              });
              proxy.on('error', function (e) {
              debug(e);
              });

              const server = http.createServer(function(req, res) {
              // You can define here your custom logic to handle the request
              // and then proxy the request.
              proxy.web(req, res, { target: 'https://api.telegram.org', });
              });

              server.listen(3333);


              And simply just redirected all the request to this server.






              share|improve this answer




























                1












                1








                1







                Ok, after hours of trying finally got this to work with proxifier.



                https://github.com/TooTallNate/node-https-proxy-agent



                new HttpsProxyAgent('http://username:password@127.0.0.1:8080')





                Update :
                This approach had its problems so I created a small personal proxy server with node-http-proxy on my server and connected to it:



                process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

                const debug = require('debug')('app');
                const http = require('http');
                const httpProxy = require('http-proxy');

                const proxy = httpProxy.createProxyServer({
                secure : false
                });
                proxy.on('error', function (e) {
                debug(e);
                });

                const server = http.createServer(function(req, res) {
                // You can define here your custom logic to handle the request
                // and then proxy the request.
                proxy.web(req, res, { target: 'https://api.telegram.org', });
                });

                server.listen(3333);


                And simply just redirected all the request to this server.






                share|improve this answer















                Ok, after hours of trying finally got this to work with proxifier.



                https://github.com/TooTallNate/node-https-proxy-agent



                new HttpsProxyAgent('http://username:password@127.0.0.1:8080')





                Update :
                This approach had its problems so I created a small personal proxy server with node-http-proxy on my server and connected to it:



                process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

                const debug = require('debug')('app');
                const http = require('http');
                const httpProxy = require('http-proxy');

                const proxy = httpProxy.createProxyServer({
                secure : false
                });
                proxy.on('error', function (e) {
                debug(e);
                });

                const server = http.createServer(function(req, res) {
                // You can define here your custom logic to handle the request
                // and then proxy the request.
                proxy.web(req, res, { target: 'https://api.telegram.org', });
                });

                server.listen(3333);


                And simply just redirected all the request to this server.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 2 days ago

























                answered Nov 20 '18 at 10:05









                ExlordExlord

                3,11921935




                3,11921935
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53388801%2fforce-node-exe-to-go-throw-proxifier-on-windows-10%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Xamarin.form Move up view when keyboard appear

                    Post-Redirect-Get with Spring WebFlux and Thymeleaf

                    Anylogic : not able to use stopDelay()