Using vlcj with proxy - vlc

I have video file which is only playable using proxy in vlc player, when I try to open it with vlcj I am unable to connect to this media - I've been trying to use http proxy configuration option in mrl ( http://path_to_media :http-proxy=proxy_address ) - but it didn't work for me yet. I've also tried setting environment variable http_proxy but it also didn't work for me. Could anyone tell me what I am doing wrong? Maybe there shouldn;t be a whitespace between path to media and configuration option? Maybe config options do not work on Windows? How can I access this video (I know I could use transcoding to do it but it seems like overkill, I feel there should be a simpler way)

Generally, if you want to pass options such as "--http-proxy" then this is the way to do it:
MediaPlayerFactory factory = new MediaPlayerFactory("--http-proxy=<your settings");
Or:
String yourProxySettings = "http://whatever.com";
MediaPlayerFactory factory = new MediaPlayerFactory("--http-proxy", yourProxySettings);
Then use this factory instance to create your media player.
I suppose you use this mechanism rather than using media options when you invoke play() because you are configuring the VLC instance itself, not the individual media.
Caveat: In the versions of VLC I have, I do not see the --http-proxy option reported as an available command-line option.

You could make the request in Java, retrieve a stream and use https://github.com/caprica/vlcj/blob/de90d77bc288843b4d07dad84ff9d0515e906657/src/main/java/uk/co/caprica/vlcj/media/callback/AbstractCallbackMedia.java to give it to vlcj for playback.
Edit:
Else use
--http-proxy=<string> HTTP proxy
HTTP proxy to be used It must be of the form
http://[user#]myproxy.mydomain:myport/ ; if empty, the http_proxy
environment variable will be tried.
from https://wiki.videolan.org/VLC_command-line_help/. First try to find the correct command with the normal VLC CLI. Share your try in full here.

Related

PAC FILE - Not being loaded

I am new to pac files. I am not sure I made it working.
I installed an nginx on a virtual machine. and exposed a pac file to url.
(I can easily download pac file by puting url in browser as proof it is working).
I then set my computer proxy settings as explained in many guides. I ticked the automatic proxy settings and I then put pac file url.
After that I think the file is not being loaded.
puting : "chrome://net-internals/#proxy" gives an empty list while it should show the pac file. Plus the net seems to work as the pac is not even there.
For further information, since I am new to pac file, I am just testing a simple pac file which redirect ALL traffic to youtube.com.
can anyone help me out?
Thanks
function FindProxyForURL(url, host) {
return "youtube.com";
The format to return is something like return "PROXY youtube.com:80". However I do not think this will work, as Youtube is not a proxy.
PAC files must return a Proxy. But Youtube is just a site, which is something completely different than a Proxy.
PAC files are unable to replace a Proxy. All they do is to point to the proxy to use when you want to reach some specific URL. This way you can configure how to reach certain networks, like some Extranet (via some dedicated HTTP proxy or TOR or I2P (via SOCKS proxies). This is why you also must specify the type of the Proxy used and the port number where the Proxy sits. Just a name usually is not enough.
Also note that you can give more than just one Proxy. For more information on PAC-files see the main documentation:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file
(Sorry for the link, but if a Link to MDN ever breaks, the Net probably has some bigger trouble than just this broken link.)

Is there an equivalent of the Reachability class for Actionscript 3?

In iOS dev it is common practice to use the Reachability class to check that you can hit a web service or other network path. I need to do something similar to check that an asset path that is being passed into a Flash SWF exists.
I don't want to run a test to load a transparent image cause this will take time to return a fault or result.
Any ideas?
Have a look at ServiceMonitor.
http://livedocs.adobe.com/livecycle/8.2/programLC/common/langref/air/net/ServiceMonitor.html
http://code.google.com/p/poliwar/source/browse/trunk/projeto/servidor/lib/air2b2/?r=66

shellexecute fails to open http links for some users

Some users of an app of mine are reporting links dont open in the browser. I always launch them with shellexecute(0, 'open', 'http://...
what could I check for an incorrect(?) setting in the http link associations?
You're assuming that the browser registered the open verb. It may not have done so.
Just pass nil as the second parameter and omit the open, and let the OS determine what the default action is for the http:// protocol, and you should be fine.
Sounds like the default browser is not functioning quite right. I guess the first thing I would try is to have them enter an (any) url into start->run and see if that pops up.
You could also have them register what the settings on the URL below are:
http://russenreaktor.wordpress.com/2010/07/01/solved-fix-default-protocol-http-association-in-windows/
Or use the ftype utility on the cmdline:
C:\Users\marco>ftype http
http="C:\Program Files (x86)\Internet Explorer\iexplore.exe" -nohome
These operate on registry keys under HKEY_CLASSES_ROOT/protocolname with protocolname=http/ftp etc.
Making a simple app to dump these keys might help finding out what the pattern here is.
FYI, this failure can be dynamic -- i.e., the old MS PhotoEditor would block opening URLS using ShellExecute. (C.f., http://code.activestate.com/recipes/334665/ ). Fix is as noted in the recipe: write out an .HTML file and shellexecute that.

Why is WSCript object not known to my script that's controlled by a custom IScriptControl?

I am using someone else's library that provides its own scripting host instance, it appears.
This lib provides me with functions to define the type of scripting language such as "jscript" and "vbscript", and I can supply it with script code and have that executed, with passing arguments in and back. So, basically, it works.
However, when I try to access the "WScript" object, I get an exception saying that this keyword is undefined.
The developer, not knowing much about this either (he only made this lib for me because I do not want to deal with Windows SDKs right now), told me that he is using "IScriptControl" for this.
Oh, and the lib also provides flags to allow "only safe subset" and "allow UI", which I set to false and true, respectively.
Does that ring a bell with anyone? Do a user of IScriptControl have to take extra steps in order to make a WScript object available? Or, can he use IScriptControl in a way that this is supplied automatically, just as when running the same script from wscript.exe?
Basically, all I need is the WScript.CreateObject function in order to access another app's API via COM.
I don't know why WScript is not known, but I suspect it is because the script host doesn't provide it. Maybe only wscript.exe does this.
If you are using Javascript, to create an object you can use new ActiveXObject(). If you are using VBScript, you can just use CreateObject.
See this article for some background.

JavaFX url-proxy?

My computer is running behind proxy. I want to access url from JavaFX. for example say i want to show image from a url. But i haven't seen anyway to provide proxy settings for the connection(?). Please if someone can tell me how to do things in such situation?
Thanks
As link in accepted answer doesn't work anymore I'm adding proxy setting code here:
System.setProperty("http.proxyHost", "myproxyhost");
System.setProperty("http.proxyPort", "80");
By default, JavaFX will automatically use your Operating Systems proxy settings, this is controlled via the Java Preferences or Java Control panel icons on your Mac or PC.
You can also set, within Java, the proxy environment variables, but I haven't tried this.
If you are trying to request an external resource from an unsigned application, Java may prompt you (the user) for permission when it runs.
Setting proxy in Java/FX

Resources