Changing repeater URL to my own server?

Can I change the default repeater URL form the smartftp.com server, to my own i.e. repeater.myserver.com?

The response returned is simply enough - a HTTP call that returns the IP address of the host in a string as the content.

But how to make SmartFTP lookup my server instead of the default one?

Thanks RossH

Hi,

Maybe changing your hosts file...

Launch the Notepad and open the file:
- C:WINDOWSsystem32driversetchosts (under XP)
- C:WINNTsystem32driversetchosts (under NT, not sure)
Add a line like :
127.0.0.1         repeater.smartftp.com
(change the IP address with the one of your server)
Save and close (this file may have the read-only attribut, so change it before saving and put it back after [read-only highly recommended])

So, now any software looking for "repeater.smartftp.com" on your computer will go to this IP address. If you use a server based on VirtualHost, you will need to change your VirtualHost from "repeater.myserver.com" to "repeater.smartftp.com" (okay, I am using many technical words, tell me if you need more explanation).

This is not the best way but it's a good workarround.

Regards,

Olivier

Thanks Olivier,

I tried that initially. The problem is still to identify and discover the WAN IP. Hard numbering it into the local hosts file wont do. And I'd still need to make a sever to respond locally.

But I have found some success. In the Registry under the HKCUSoftwareSmartFTPNetwork is an item named "IP Repeater Host". Changing this will redirect the IP repeat check to anything you want.

Note that you need to specify it in a DNS A record to match. Then setup a subdomain there and return the IP as text. All that works OK but...

The SmartFTP makes this request at port 443 (GET ). Now here is the catch: It makes this request as plain text - not encoded. My server (Apache) will issue Error 400 - transmitting plain text over a secure connection....

And if you look at the packets to the default of repeater.smartftp.com, it also transmits plain text over port 443. Looks like a error in design.

Only thing I can thing of, is to somehow force the repeater onto port 80, where plain text is allowable?

Looking harder now... regards RossH

The harder I look at this, the more it appears to be a bug.

We can change the URL called to my own server using the Registry value "IP Repeater Host" But the SmartFTP calls that URL using the HTTP protocol at port 443. i.e. HTTP should go to port 80, and only HTTPS should go to port 443.

That's the problem. A properly configured server will reject the non secure HTTP calls at port 443, as a security risk, giving error 400.

The server at repeater.smartftp.com will accept HTTP at 443. Further more it does not appear to engage in a secure connection with certificate exchanges.

Regards Rossh

Hello ...

I have to disappoint you, but the design is a little bit more sophisticated than you think :-)

Port 443 has been chosen to circumvent the proxies. As far as I know they don't cache "ssl" connections. This is the more reliable way than using HTTP headers (no-cache, expire etc) to force the proxy to reload the content in my opnion.

BTW: It's easy to configure Apache to deliver normal content on port 443 instead of 80.

Listen 213.144.155.16:443







<VirtualHost 213.144.155.16:443>



...



</VirtualHost>

Hello ...

The ip repeater feature has never been designed to be fully customizable or adaptable to any web server running in the wild. The "special configuration" doesn't require more than the configuration settings I've posted. Nevertheless I've added a new setting which allows you to specify the full URL to the ip repeater host.

It can be found at:
HKEY_CURRENT_USERSoftwareSmartFTPClient1.0Transfer
IP Repeater URL

The new version with this setting is available at:
https://www.smartftp.com/download

Regards.
-Mat

Mat,

Many thanks for the addition. This now allows us to replicate the repeater on any normal server, and call it that way.

Still one more problem though. The HTTP call from SmartFTP is made using the http/1.1 protocol. If the smartFTP does receive a true 1.1 response, with included Transfer-Encoding: chunked, it miss reads the returned data, and includes the additional trailing characters into the string interpretation. i.e. the leading and trailing data for the encoding per HTTP 1.1, that surrounds the content. It would appear that the component reads the raw data off the socket, without stripping off the encoding chars.

Again, this make it hard to make the program utilize a different repeater than yours. I have managed to trick the smartFTP by appending a bunch of text onto the returned IP numbers

$s = "$ENV{REMOTE_ADDR}" . 'ZZZZZZ';


Your own repeater server issued response is labeled 1.1, but it does not include the Transfer-Encoding header and characters from the response. Hence the SmartFTP has managed to dodge this error.

May I suggest the corrections are to either, a/ make the initial call using HTTP 1.0 protocol, or b/ have the SmartFTP accept the complete 1.1 responses.

Regards Rossh

Mat, Many thanks for attending to this. All fixed and working great.


For those who would like to do the same with their server:

1/ Change the URL that SmartFTP calls by specifying it at:
HKEY_CURRENT_USERSoftwareSmartFTPClient1.0Transfer. String value of "IP Repeater URL". Include a port number!

eg. http:myhost.com:80repeatermydoc.cgi

2/ Either, a/ Make a subdomain on your site, and an entry onto the DNS for this. Or b/ Use a sub directory in your domain or a script.

3/ Using perl or php, use a script such as this (perl shown). Return this for every call made to this URL.
#!/usr/bin/perl



print "Content-type: text/plainnn";



print "$ENV{REMOTE_ADDR}";

You might also like to investigate web caching problems and apply these to the returned data headers. This will be specific to your version of server software. Some details here:

http://www.mnot.net/cache_docs/

Regards RossH