Can we create sftp proxy using apache camel? - apache

There is an application that's sending files to sftp server which was implemented by java.
To test that, we need to introduce some delay in transferring files.
Is there any way in apache camel to create a sftp proxy so that my application sends file to camel and camel send to actual sftp server with delay. without breaking any sftp mechanics.
Thanks,
Chinna

Related

Create a simple sftp server for use with Mule

I am looking to setup a local mock SFTP server to use with Mule.
I have a SFTP endpoint and would like to process files from c:/temp/file directory on my local machine.
I have looked at MUnit but would like to run my Mule project like I would in Production and I feel MUnit is more geared towards Unit Testing.
I have looked at FreeSSH and OpenSSH but due to privileges on my laptop I have been unable to install them because they run scripts. I have also looked at CrushFTP but have had problems connecting to the sftp server.
Could anyone recommend a simple SFTP server I could setup locally to work with the Mule connector?
Thanks
I used solarwinds SFTP server to explore mule sftp connector.
http://www.solarwinds.com/free-tools/free-sftp-server/
I made sham-ssh which contains an in-process SFTP server that I use for production-like functional testing. It allows you to use SSH or SFTP over a localhost network connection, and uses a directory on your hard drive to store the files. It's not 1.0 yet, and has no documentation yet, but might work for you.

What is HTTPD exactly?

I mean is "httpd" only used by Apache for the download of the software or is it used by other websites as well? Also is it necessary to have httpd to run "cgi" or not?
And why does Apache use httpd to download the http server instead of having it in a file on their http website?
Apache HTTPD is an HTTP server daemon produced by the Apache Foundation. It is a piece of software that listens for network requests (which are expressed using the Hypertext Transfer Protocol) and responds to them.
It is open source and many entities use it to host their websites.
Other HTTP servers are available (including Apache Tomcat which is designed for running server side programs written in Java (which don't use CGI)).
CGI is a protocol that allows an HTTP server to use an external piece of software to determine how to respond to a request instead of simply returning the contents of a static file. Many HTTP servers support the CGI protocol.
You can use CGI without an HTTP server, but this typically has few uses beyond allowing a developer to perform command line testing of the CGI program. (You certainly can't interact with it directly from a web browser).
HTTP Daemon is a software program that runs in the background of a web server and waits for the incoming server requests. The daemon answers the request automatically and serves the hypertext and multimedia documents over the Internet using HTTP.
Apache Httpd is basically a web server used for handling requests and delivering static content. While CGI is a protocol which adds a scripts with the request and based on the script the content is delivered instead of simply returning a static content. So it is not necessary to use CGI with apache httpd but for delivering a dynnmic content httpd and cgi are used together.
Also using httpd with cgi is a very heavy process of delivering dynamic content as it creates and destroys process with every request response cycle, there are many other efficient alternatives with latest technology.
HTTPd - HyperText Transfer Protocol Daemon
HTTPd is a software program, that usually runs in the background, as a process.
It plays the role of server in a client-server model using HTTP and/or HTTPS network protocols.
HTTPd waits for the incoming client requests and for each request it answers by replying with requested information.
Following are some commonly used HTTPd
Apache
BusyBox
CERN HTTPd
Lighttpd
Ngnix

file upload to SFTP server from a jsp page

I have a webpage which contains the button to upload a file. My requirement is, when user chooses the file to upload and click the submits it, the file should get transferred to an SFTP server. My question is, do I need a SSH client installed on the client machine for achieving this?
I thought of uploading it to my http server as a temp file first and then to the SFTP server from there, but then what's the purpose of SFTP on the first place as the file will be transmitted to server as unencrypted.
JSP is a server side technology. If JSP is going to be involved, then the code has to run on the server.
My question is, do I need a SSH client installed on the client machine for achieving this?
No. The server has to do the work.
I thought of uploading it to my http server as a temp file first and then to the SFTP server from there
That's how you would have to do it.
There's no way to interact with the SFTP protocols directly from client side code in a webpage.
then to the SFTP server from there, but then what's the purpose of SFTP on the first place
Good question: But you decided to use that technology, so that's up to you.
as the file will be transmitted to server as unencrypted.
To secure communications between the browser and the HTTP server, use HTTPS instead of plain HTTP.

SFTP file upload in WCF service

Can anyone help me out on how to implement file upload from mobile device to Dotnet service using SFTP process using WCF service or any.
WCF works on HTTP protocol with or without SSL.
SFTP works on SSH protocol with or without SSL.
FTPS works on FTP protocol using SSL.
First make sure what you exactly want to do and which protocol is suitable for your case.
If you are looking to transfer a file using WCF try to use Stream as input type and store it on a physical location on the disk.

Using Jetty to serve a web application

I am using Jetty for the first time to deploy a GWT web app connecting to a Restlet API and I am trying to understand the best way to use it.
I want to make it embeddable so that I can update config during run-time (allowing me to add new domain names etc).
Our web server currently runs Apache to serve a PHP web app and this will be our first time deploying a GWT app and using Jetty.
Is it possible to use Jetty in parallel with Apache (both serving requests on port 80) and since I am embedding it do I use Apache before it reaches Jetty? So Apache receives request and forwards to Jetty?
Both server cannot run on same port. But you can run both on same machine. So use a separate port for jetty.
Jetty receives the request through its own port and doesn't depend on other server.