I am building an enterprise browser based application, which works on a dedicated PC with a touch screen (think of it as a Kiosk, sort of). So, the application itself is built on NodeJS and the user makes choices on the browser and inserts their Smart Card. Since JavaScript can't directly read and decrypt the Smart Card data, a Java program running on this PC detects the inserted Smart Card and reads the data. Now, the problem is to send this Smart Card details (name, address etc..) to the JS code. I'm not really sure how to solve this, the following are a few ideas:
Each of the above have their own pitfalls. I'm not sure how other Kiosk based systems work, so any suggestions or improvements on the above ideas would be great.
The best solution here would probably be to host a WebSocket using Jetty in your java application at 127.0.0.1 and have your javascript connect to that directly . No cloud server would be needed as WebSockets aren't bound to the same origin policy or cross origin resource sharing.
Another potential solution is to have an embedded browser in your java program using javafx's webkit or other java browser implementation and share data through that. This is less than ideal because javafx's webkit has it's own weird quirks and commercial embedded browsers for java cost thousands.
I would use the websocket solution.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.