Internal network HTML/Java applet file sharing permissions - java

Sorry if my title is unspecific, I couldn't think of a better way to word it.
Here's the situation. I've set up one box to stream webcam footage, I'll call it Box A. I'm on my computer and trying to get that footage; I'll call my computer Box B. (I'm using Ubuntu on both computer.) I followed the instructions here pretty much verbatim:
http://hacktivision.com/index.php/2009/06/16/setting-up-an-ubuntu-webcam-server.
I'm using "webcam-server" to set it up. I downloaded Apache2 and am using that to set up the web interface. The webcam on Box A take footage and streams it to "HTTP://localhost/webcam". I'm trying to hit "HTTP://[Box A's internal IP]/webcam". However, when I do, it just gets stuck at the "Connecting..." screen.
I tried hitting the /index of Box A and that worked. I can also hit "[Box A's internal IP]:8888", which gives me snapshots of the webcam on Box A. For some reason though, I'm not receiving the data from the applet (the /webcam).
I've tried to figure out this problem for quite a few hours, with no success. Is there perhaps some kind of permissions that Box B needs to use Box A's applet? Or maybe I need to make the HTML file on Box A public?
Feel free to ask for whatever info you need to try to fix the problem. I apologize if I left out any relevant information.

Okay, here is an idea for a solution.
If you simply copied the applet's HTML file, then this applies (from the instructions you linked):
The java applet in the webcam.html file is, by default, configured to stream at 1 frame per second.
It is also configured by default to use “localhost” as the domain.
As localhost in your box B browser refers to box B, the applet tries to connect to this computer ... and this firstly is not allowed (if the applet is not signed - no idea if it is), and secondly there is no webcam-server running there.
The solution is in the following sentence:
Here’s an example of a webcam.html
file with a maximum FPS of 60 and hosted on hacktivision.com:
Copy this example, and replace hacktivision.com with box A's IP address (or the computer name, if you have an internal DNS or fitting hosts configuration).
(By the way, my Ubuntu 11.04 seems to have no webcam-server package.)

Related

Java Control Panel Proxy Settings - where are they stored?

I have... a situation. Imagine you have many, many PCs (Windows 7 to 8) that run a Java Application which is started by using a .jnlp. Now finally there has been a version-jump from java 6 to 8 (took way to much time), and suddenly this application wont start any more (can't parse first jnlp, javaws tells me).
To solve this we have to insert the correct proxy-setting inside java-control panel (wasn't necessary with the old version).
So... doing this by hand is a task that most users can't perform (sadly their level of knowledge isn't sufficient), but doing ths by myself at all PCs would take... uh... a really long time.
So we decided to create a little batch-file, that does perform all the stuff necessary (installing latest jre, clearing cache and so on) which just has to be runned once at every users PC. In Theory.
We were able to place all steps necessary in that .bat, except for setting the proxy at the java control panel. I wonder if this is possible at all. The javaws arguments don't contain such an argument, and I wasn't able to find a physical storage whatever inside the jre or the java cache.
And I can't use these -dHTTP.xxx.... flags for that .jnlp file I'm afraid, because that java webstart is the one that need to know the correct proxy-settings, not the application.
So is there a way to change the proxy setting you can access with the java control panel by some command line argument or something like this, enabling myself to complete this "all new" script?
Greetings, ConfusedMerlin
Java control panel settings are located in %userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
to add proxy you can use something like
(
(echo(deployment.proxy.bypass.local=true)
(echo(deployment.proxy.type=1)
(echo(deployment.proxy.http.host=10.10.10.10)
(echo(deployment.proxy.http.port=10)
)>>"%userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties"
though if there are already set proxy you'll need to replace the data.

Hide java confirm dialog in signed applet

I have an applet that receives an XML that serialized a JasperPrint object and print it using printservices. The applet is signed and the certificate is imported in house.
This applet is in a Web application that call it using javascript and it runs in terminals with Windows XP.
The problem is that when you use the applet always displays the prompt to run the application and users have to confirm to print.
Is there any way around this without ever having to confirm?
UPDATE:
i google the problem and i see that applet is dying (like #user3712670 says),
there are another alternative to run java code on client pc from a web page?
i need to use it locally
Short answer: no.
Any settings for those confirmation dialogs are client-side, so there's nothing you can do in your code or on your server to prevent them.
You might be able to get rid of some of them by making your clients change their security settings, but this is probably not advised. And you probably can't get rid of all of them.
You can check the plugin settings for the particular browser you're running, and you can check the Java security settings from the Control Panel.
The real answer is that applets are a dying technology, and trying to make them work is a bit like plugging up the holes in a sinking ship.

Red5 Screensharing is not working in Ubuntu

I have ubuntu environment. I want to have a screenshare option in my webapplication. I am using red5 for that. I can stream using red5, so thus no problem with installation.
I am using screenshare application from here.
https://code.google.com/p/red5-screenshare/downloads/list
I have followed everything mentioned here
http://devsteps.blogspot.in/2012/02/red5-screenshare.html
I runned it and started screen sharing. But the problem is, its not creating any screen_share.flv file in my streams folder. And, when I access screenviewer.html via
http://localhost:5080/screenshare/screenviewer.html
its giving only blank screen.
What is the problem. Any suggestions?
Edit :
I don't know, whether its true or not. But red5-screenshare application is working with ubuntu-32 bit systems but not with 64-bit.
Now I installed 32-bit os. And, I say, partially this application is running.
But again getting few problems here.
I can able to see my screen but its giving output like this
Its may be because, I am viewing it in my computer (server and viewer is same) so, its coming like this (?).
And I have another problem also, Its not getting accessed in other systems. In other systems, I am only getting a blank screen. No console errors too. Unable to find a way to forward. Can anyone help me here.
To have an flv file created in your streams directory the client application would need to be publishing in "record" mode, it is more than likely that it is publishing "live" instead. If you need it to record, you have to change the publish call in the client source or turn on recording for all streams via the servers red5.properties file.
broadcaststream.auto.record=true
I solved it!
First problem, as I guessed its because I am viewing my own screen so mirror views are generating.
Second problem, Its because of static url declaration. Here is the modification. In screenviewer.html
var tot_url = document.URL; //url: http://192.x.x.x:5080/screenshare/screenviewer.html
var http_removed_url = tot_url.split("//")[1]; //remove http:// from original url
var ip_port = http_removed_url.split(":")[0];//filter only ip and port : 192.x.x.x:5080
var stream = getPageParameter('stream', 'screen_share');
var url = getPageParameter('url', 'rtmp://'+ip_port+'/oflaDemo');
And, it worked for me. A small bug is there, its not working in firefox. I think its different issue now.

How to enable MSIE8 in 'Default Java for browsers'?

I'm using IE 8.0.7600.16385 for testing (the default browser is FF) an applet.
The applet is part of a project to deliver music off CD & DVD (it is an MP3 player).
It was working around a month ago (or so), but when the page is loaded from
local disk now, it does not pop the Java Console (which is configured to open
automatically for applets and JWS apps.), & does not load the applet. Instead it
puts a little icon in the upper left of the space the applet should be
that looks like below (the red arrow points to the icon).
Clicking the icon and everywhere else around the applet space produced no further information.
After trawling through the IE options, particularly under the Security, Content & Advanced tabs
and setting all the options I thought might help (to no avail), I opened the Java Control Panel
to see..
So it seems that something in Java itself is stopping IE from loading applets.
How do I reconfigure Java to enable the IE listing under 'Default Java for browsers'?
Update 1
IE will happily load the applet shown at Property Probe (a sand-boxed applet on my site). While another tab of the browser will fail to (attempt to load and) render the applet off the local file system. I am tending towards putting this down to something that changed in IE, though I cannot see how it could have changed between the old and recent tests. The JCP is still showing the IE entry grayed out, which suggests that is its way of indicating that IE is not the default browser (?).
I also noticed that a similar version of IE on the Netbook fails to load the applet off disk with the same symptoms. :(
Update 2
The problem applet is load into a frame (yeah sure, 'ick frames!' get over it) using deployJava.js - a script supplied by Oracle to do version checking before running an applet.
A plain applet in unframed HTML will load just fine off the local file system. I'll do further tests to narrow it down to the 'frames' or the script. But I am betting it will be the script that triggers this behavior.
deployJava.js is the deciding factor. An applet in:
framed HTML
loaded off the local file system
..works in IE8 - unless it is
embedded using the script.
Since I have other ways to do what was needed from the script (plug-in version checking), I'll remove the script and use the alternate method.
And to answer the question as to why the behavior in IE 8 changed. Last time it was tested in IE, the applet element was hard coded in the HTML, no script or version checking used. :P

Is it possible to edit a file on computer from within a browser?

I would like to know if it's possible to edit a file from within the browser. I know where the file is and I know its format. I would like to some HTML5 and JavaScript but have little luck so don't mind using Flash or Java.
The file I would like to edit is the hosts file. C:\WINDOWS\system32\drivers\etc\hosts on Windows XP.
This is mostly for test run of a new breed of AdBlocking so would like to give my browser and the best chance of working. I have Google Chrome Dev opened as ROOT, running on Windows XP.
Java applet with the correct permissions can access the file probably but how easy is it for the user to setup those permissions is a question I can not answer.
Flash is not going to work 100% as it can not be loaded from the internet and access the hard drive at the same time, without going into details you can trust me on that one as the security model simply does not allow it and there is no actual API inside flash to read the file, one can only forward it through to a server(only upload, no download), nothing more (if running from the internet sandbox).
Javascript - not sure, i kind of feel like it can't for similar reasons as Flash but somebody should probably confirm.
The add-blockers usually work as addons to the browser so you should probably do the same as you should have access but then again, you probably won't need it in that case...
In any case, Flash definitely is not going to work.
Java applets can as long as they are signed ..
Follow these intructions to sign an applet.
P.S these instructions are for a linux setup. You might need to set up environment variables in windows.
Jar signing link
so al long as the users allow the applet to run the applet the applet can modify anything on the file sysem and even open connections to other computers.. and most importantly the applet can be hidden in a corner if that is what you wish
Editing local files from a browser, especially a system file, is something that all browser vendors actively try to PREVENT. This is because all the virus makers are actively trying to edit these too!
If you want an ad blocker editing the hosts file to do it is a terrible idea for a number of reasons. First of all it is only going to work on Windows and your ad blocking won't help for Mac and Linux users. Second it will require permissions escalation on Vista and Windows 7. Third it would have to be reliant on something like ActiveX or Java. Fourth the hosts file would eventually get large. Large hosts file slow down internet browsing because you have to do a full lookup every time.
If you want to block ads, block them at the browser level. I hope I have convinced you that modifying the hosts file for this is a bad idea.

Categories