On 20 November 2012 21:31, Adi Roiban <span dir="ltr">&lt;<a href="mailto:adi@roiban.ro" target="_blank">adi@roiban.ro</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I don&#39;t think there is support for configuring the advertised IP address.<br>
I don&#39;t know how EC2 ip forwarding works and how can you retrieve it.<br>
<br>
To use another IP address, in FTP.ftp_PASV(), look for the following lines:<br>
<br>
        self.dtpPort = self.getDTPPort(self.dtpFactory)<br>
<br>
        host = self.transport.getHost().host<br>
        port = self.dtpPort.getHost().port<br>
<br>
Just replace &#39;self.transport.getHost().host&#39; with your required IP or<br>
another method for retrieving the IP address.<br>
<br>
Cheers,<br>
Adi<br>
<div><div class="h5"><br></div></div></blockquote><div><br></div><div>Cheers Adi, I&#39;ve made a function that launches &#39;curl <a href="http://ifconfig.me">ifconfig.me</a>&#39; through subprocess, and I call that and save it when the server starts.</div>
<div><br></div><div>Is this definitely the only place where I need to override the host?</div><div><br></div><div>I&#39;d rather wrap the transport object to be sure but twisted is still pretty magic to me and I&#39;m struggling to find out where this ProtocolWrapper object is originating from.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
On 20 November 2012 22:47, Paul Wiseman &lt;<a href="mailto:poalman@gmail.com">poalman@gmail.com</a>&gt; wrote:<br>
&gt; This possibly has nothing to do with twisted, but maybe if not someone may<br>
&gt; be able to point me in the right direction!<br>
&gt;<br>
&gt; Basically I&#39;ve set up a twisted FTP server on ec2, and when a client tries<br>
&gt; to enter passive mode I&#39;m getting this:<br>
&gt;<br>
&gt; Response: 227 Entering Passive Mode (x,x,x,x,159,122).<br>
&gt; Status: Server sent passive reply with unroutable address. Using server<br>
&gt; address instead.<br>
&gt;<br>
&gt; the x.x.x.x is the boxes private IP, rather than its public IP.<br>
&gt;<br>
&gt; It&#39;s getting this from ln. 851 in twisted/protocols/ftp.py v12.2.0<br>
&gt;<br>
&gt; Is there somehow I can change the way twisted is getting the IP, or is this<br>
&gt; an issue with the server set up itself?<br>
&gt;<br>
&gt; Any pointers or help on what to look/check for would be of huge help!<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Paul<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Twisted-Python mailing list<br>
&gt; <a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
&gt; <a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
&gt;<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Adi Roiban<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</font></span></blockquote></div><br>