<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>MultiChain Developer Q&amp;A - Recent questions tagged tcp</title>
<link>https://www.multichain.com/qa/tag/tcp</link>
<description>Powered by Question2Answer</description>
<item>
<title>SOCKS 5 Proxy Connection</title>
<link>https://www.multichain.com/qa/36178/socks-5-proxy-connection</link>
<description>&lt;p&gt;I have a chain running on AWS that is connected to an application hosted on Heroku&amp;nbsp;which&amp;nbsp;uses dynamic IP's. I've installed a SOCK5 proxy add-on that returns a couple static IP addresses for me to use. However, when I&amp;nbsp;update&amp;nbsp;the multichain.conf file with a&amp;nbsp;static IP, the connection&amp;nbsp;fails. Works just fine when I use&amp;nbsp;rpcallowip=0.0.0.0/0&lt;br&gt;&lt;br&gt;In the example below, the&amp;nbsp;vendor demonstrates a SOCKS5 connection&amp;nbsp;to MySQL request. Can someone translate the configuration&amp;nbsp;to multichain setup that uses multichain-node (json-rpc)&amp;nbsp;commands.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;var&lt;/span&gt; mysql &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;require&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;'mysql2'&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;    url &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;require&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;'url'&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    SocksConnection &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;require&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;'socksjs'&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;var&lt;/span&gt; remote_options &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;{&lt;/span&gt;
    host&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;'your-database.eu-west-1.rds.amazonaws.com'&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    port&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color:rgb(241, 78, 137)&quot;&gt;3306&lt;/span&gt;
&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;var&lt;/span&gt; proxy &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; url&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;parse&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;process&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;env&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;QUOTAGUARDSTATIC_URL&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    auth &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; proxy&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;auth&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    username &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; auth&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;split&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;':'&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:rgb(241, 78, 137)&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    pass &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; auth&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;split&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;':'&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:rgb(241, 78, 137)&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;var&lt;/span&gt; sock_options &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;{&lt;/span&gt;
    host&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;:&lt;/span&gt; proxy&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;hostname&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    port&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color:rgb(241, 78, 137)&quot;&gt;1080&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    user&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;:&lt;/span&gt; username&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    pass&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;:&lt;/span&gt; pass
&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;var&lt;/span&gt; sockConn &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;SocksConnection&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;remote_options&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt; sock_options&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;var&lt;/span&gt; dbConnection &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;=&lt;/span&gt; mysql&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;createConnection&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;{&lt;/span&gt;
    user&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;'dbuser'&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    database&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;'dbname'&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    password&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;'dbpassword'&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt;
    stream&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;:&lt;/span&gt; sockConn
&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;
dbConnection&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;'SELECT 1+1 as test1;'&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;err&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt; rows&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt; fields&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;err&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;throw&lt;/span&gt; err&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;

    console&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(118, 217, 230)&quot;&gt;'Result: '&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;,&lt;/span&gt; rows&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;
    sockConn&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;dispose&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;
dbConnection&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:rgb(167, 122, 254)&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:rgb(207, 215, 214)&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/36178/socks-5-proxy-connection</guid>
<pubDate>Sat, 31 Jul 2021 01:09:00 +0000</pubDate>
</item>
</channel>
</rss>