Apache Commons VFS get or put files over a port-mapping - sftp

I have a question with using commons-vfs2 just like the picture, there is a server between the client and the file server which used to map the file server port from 22 to 10022, how can i use the commons-vfs2 upload or download file from the file server via sftp and ftp protocol?
I tried to use proxy like following code:
SftpFileSystemConfigBuilder.getInstance().setProxyHost(opts, "xxx.6.2.xx");
SftpFileSystemConfigBuilder.getInstance().setProxyPort(opts, 10022);
SftpFileSystemConfigBuilder.getInstance().setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_HTTP);
but it's not work, the picture url is http://ccwuj.img44.wal8.com/img44/507529_20150115150159/143279929037.jpg

Related

import OpenVPN config file to WireGuard

I have a bunch of OpenVpn (.ovpn) files what i downloaded from my private vpn account.
I wanted to use WireGuard client but it only accept zip and .conf files, is there a tool to convert it? Or can i extract data from the .ovpn file to add a config to Wireguard?
I saw, the two file formating completely different.

VOD not playing after s3 recording enabled in Ant Media server

I have enabled s3 recording in application settings on dashboard but when trying to play VOD from dashboard it gives error "The media could not be loaded, either because the server or network failed or because the format is not supported."
Problem:
This error generally comes when HTTP forwarding is not configured on Ant Media Server for S3 Recording.
HTTP forwarding is implemented to forward incoming HTTP requests to any other place. It's generally used for forwarding incoming request to a storage like S3.
Solution:
Here's how HTTP forwarding can be configured on Ant Media Server:
Open the file {AMS-DIR} / webapps / {APPLICATION} / WEB-INF / red5-web.properties with your text editor.
Add settings.httpforwarding.extension=mp4 to the file.
Add the base URL with settings.httpforwarding.baseURL=https://{YOUR_DOMAIN} for forwarding. Please replace {YOUR_DOMAIN} with your own URL. Please pay attention that there is no leading or trailing white spaces.
e.g.,
If you are using AWS S3 bucket, {YOUR_DOMAIN} will be like:
{s3BucketName}.s3.{awsLocation}.amazonaws.com
If you are using Digital Ocean Spaces, {YOUR_DOMAIN} will be like:
{BucketName}.{BucketLocation}.digitaloceanspaces.com
Save the file and restart the Ant Media Server with sudo service antmedia restart
If it's configured properly, your incoming MP4 requests such as https://{SERVER_DOMAIN}:5443/{APPLICATION_NAME}/streams/vod.mp4 will be forwarded to https://{YOUR_DOMAIN_HERE}/streams/vod.mp4
antmedia.io

IMAP Proxy that can connect to multiple IMAP servers

What I am trying to achieve is to have a central Webmail client that I can use in a ISP envioroment but has the capability to connect to multiple mail servers.
I have now been looking at Perdition, NGINX and Dovecot.
But most of the articles have not been updated for a very long time.
The one that I am realy looking at is NGINX imap proxy as it can almost do everything i require.
http://wiki.nginx.org/ImapAuthenticateWithEmbeddedPerlScript
But firstly the issue I have is you can no longer compile NGINX from source with those flags.
And secondly the GitRepo for this project https://github.com/falcacibar/nginx_auth_imap_perl
Does not give detailed information about the updated project.
So all I am trying to achieve is to have one webmail server that can connect to any one of my mailservers where my location is residing in a database. But the location is a hostname and not a IP.
You can tell Nginx to do auth_http with any http URL you set up.
You don't need an embedded perl script specifically.
See http://nginx.org/en/docs/mail/ngx_mail_auth_http_module.html to get an idea of the header based protocol Nginx uses.
You can implement the protocol described above in any language - CGI script with apache if you like.
You do the auth and database query and return the appropriate backend servers in this script.
(Personally, I use a python + WSGI server setup.)
Say you set up your script on apache at http://localhost:9000/cgi-bin/nginx_auth.py
In your Nginx config, you use:
auth_http http://localhost:9000/cgi-bin/nginx_auth.py

Uploading file to a web server in QT

I need to upload a file using ftp or http. I checked downloading from servers like ftp.qt.nokia.com. where download was successful[even though the file(s) downloaded was broken but with almost same size as on Web server]. I tried to upload a file to servers like qt.nokia.com,ftp.trolltech.com. Doing so When I used http, I got an html doc as a response with error count 0,but error string as unkown error. When I used ftp, connection was established, logged in but didn't close connection and again error string unkown error. My point is how can I know that whether my file is uploaded to a server successfully? Can I check it on my own system by setting up a server(for ex: Apache Tomcat server).
Set up a local FTP or HTTP server, you should not rely on any server you don't have full control over. A virtual machine is the probably the most hassle-free solution.

How to get files http address from ftp server in Java?

My program uploads a picture in the ftp server and I need to get the http address for the picture. How can I do it so it would be dynamic and independent of a specific server?
There is nothing whatsoever that says it has an HTTP address, and if it does it is totally under the control of the server configuration. There is no defined mapping.
Does not exist any fixed rule that associate an http address from ftp address. And it does not depends on Java.
It's only a configuration problem, whatever language you use; you have to know when you upload a file on a ftp server if that file will be reachable through an HTTP server and what address it will have.
Paths on ftp servers and http server do not correlate. The only solution I could imagine is:
Know the "server root path" for both HTTP and FTP server
Know the path relative to this root
Combine these two to the full path
Nevertheless there is no guarantee that it will work in every case. It relies on the fact that you can establish a manual mapping of the server roots (see EJP's answer).

Resources