How to performant connect a FTP Server to a Webdav Server? - performance

I have implemented a webdav directory in PHP using Sabre DAV, for my website (Application Server Webinterface).
For this Website I am writing now an TCP Socket using C#, which is running on another server (actualy it is in the same datacenter, but for theoretical sake, it is on the other hemisphere).
The Socket actualy is a service, which can start and stop applications (gameserver in this case). I also have implemented a FTP Service in this socket too (for data transfer).
My Goal:
I want to connect my Web Dav to the FTP-Server of my socket, which means File Listening, Download, Upload. The usecase should be, that a user only connect to a single service. Imagine, my socket is running on more then one server.
If i would implement this with my current know how, i would do it this way:
User Request Web Dav Directory
Server make a file listening of the FTP Server
The file listening is added dynamicly to the Web Dav Directory
Now the user open the directory, and want to download the file:
Web Dav Server request the file from the Ftp server
Web Dav Server provide the downloaded file
Web Dav Server delete the provided file
On the other direction, the WebDav Server will accept a file, and upload it then to the FTP Server.
If the servers are not in the same datacenter, this cost traffic. Anyway, i think it takes some time, if the data are binrary instead of textbased configs. Also, the client side progress bar will not notice, if the download to the webdav server / upload to the ftp server is processed (the user possible think nothing happens).
I hope i have successful communicated, where my problem is.
So how can I implement this, without delegate an upload/download from one server to another? Is this even possible?
Bonus: Would a solution like WebDav to Webdav or FTP to FTP provide a better way of implementing it?

Easy way to achieve this is to have a third party software like webdrive to map the ftp server contents to a drive letter. Then point the webdav server to this drive. Windows also provides option to map a webdav/ftp URL as a drive letter so that the application can access it as if its a local drive.

Related

Using Squid to forward traffic to specific IP address

I have an issue I can't seem to figure how to solve. I am thinking of using Squid for this but not 100% sure how to configure. A developer is writing a script that will request an XML file from a secure web server.
The script will live in a cloud-based application and will send the request for this XML file to the web server, the script will then translate the XML file content into readable data using API calls and presented to the user in the application.
The problem is the following:
The application server (A) its load balanced and the IP address may not always be the same. We do not own this app server only have access to APIs
The Web server (B) that owns the XML is behind a firewall and it has to specify the incoming IP address allowed to access this content
I am thinking I would have to configure reverse proxy on Squid that will receive the script/request from any IP address (preferably from the application servers only) and would have to forward the exact request to the IP address of the Web server that owns the XML file.
This means that I would have to specify the IP address of the proxy server rather than the web server in the script and somehow allow the proxy server to know it needs to forward it to the web server.
I'm not sure how to do this securely since in this scenario as ANY external IP address coming the proxy server will be forwarded over.
(A) App server ======> Squid Proxy =======> (B) Webserver
I hope this makes sense thank you so much in advance for your help.

Is it possible to open a WebSocket to client localhost?

I've to design a solution that permits to read real-time data generated by local sensors through a remotely-hosted web application.
The design is still work in progress: the sensors' data could be handled by a windows application/service installed on the client machine, or by some external hardware (like a raspberry) located on the same network of the client machine.
Now, I'm very new to WebSockets, but they seems exactly what I need for providing real-time data via browser.
My question is: can a remote web application open a WebSocket to a server that is located on the same local network which the client belongs to?
Is solution B possible? How can I achieve that?
For example, I'd like the server to be located on the client localhost. Sensors would send data to the local windows service, and the web application would show them by opening a WebSocket to localhost (client localhost, not server localhost!).
Well, I did some testing and the answer is yes, it is possible.
Test setup:
A web page hosted on a remote server, with a WebSocket client which connects to 'localhost'.
WebSocket server running on my pc.
It worked.

Can you use FTP with Google Compute?

Hey I'm just wondering if there is a way to setup a regular FTP server on Google Compute. SFTP works, but I'm migrating from a physical server to google, and already have 100's of regular FTP users. I would rather not have to get them all to switch to SFTP if I don't have to. (I would like to do that long-term, but I don't want to break all of their connections when I migrate.)
Yes, you can use FTP. You must
Install an FTP server
Open port 21 & a range of higher ports, eg 49152-65534.
Configure the FTP server to use the port range from (2) for Passive FTP
Configure the FTP server for your users/destinations.
That said FTP is a very insecure protocol. Migrating to SFTP is very important for your users' security.

FTP: Unable to connect to the remote server

I have a website that I use to upload images to the server and it eventually uploads them to an FTP site from the server. The problem is that it gets part of the way through the transfer - it transfers some of the files and then stops and gives the error
Unable to connect to the remote server
This only happens with 1 ftp server. I have a second ftp server on which this process works fine, so I doubt it's a code issue. What could the issue be?
thanks,
Sachin
Some FTP servers block flood requests, interrupting the connection. You should try using another FTP client and / or compress all the files, send to server and unzip them from the server using SSH or other method available.
Note: Recommend FileZilla client.

Accessing FTP Server using a specific IP Address

I want to access a FTP Server, that is firewall protected meaning only IP addresses that have been added to the safe list may access the FTP file.
And The IP address of my website has been added to the safe list of the firewall.
I am using Filezilla to connect to it, but it is not allowing me to connect to the FTP server since my PC has a different IP.
Please suggest me a way to connect to the FTP server.
Thanks In advance....
If you can ssh/telnet into your host, then you could use the command line ftp.
Another option is to use a web-based ftp client that is installed on your web server (such as http://www.phpwebftp.com/ if you have PHP).
Run an ftp client on the allowed server; or, persuade the ftp admin to add your PC's IP address to the whitelist, and ensure and/or pray that it doesn't change (maybe pay your ISP extra for a static IP); or, use a proxy on an authorized server. The first option is definitely the most painless, assuming you have shell access to your web server (and if not, what sense does it make to have it on the authorized list?)
Some popular command-line clients you might find installed on the server include ftp (sic), ncftp, curl, wget, lynx, and w3m. The last two are actually terminal-based text-only web browsers.
If you have shell access to your server, you could create a SSH-tunnel like this:
ssh user#example.org -L 21:127.0.0.1:21
then you can connect to the FTP-server using localhost:21 from your pc.
http://www.debianadmin.com/howto-use-ssh-local-and-remote-port-forwarding.html

Resources