how to send data from j2se sever to j2me client - java-me

i have coded server in j2se and client in j2me. i am able to send data from client to server using OutputStream but unable to read the data using InputStream in client and even unable to send data from server using OutputStream. can anyone please help me i am struck here

I wrote a tech tip 10 years ago that might help. It doesn't seem to be available on the Oracle site anymore, but it's accessible from the Internet Archive here: Client-Server Communication over HTTP using Midlets and Servlets.

Related

RTCDataChannel communication between server and client

I am going to create real time web application and would like to use WebRTC RTCDataChannel to exchange data between client and server.
WebRTC is created for peer-to-peer communication. However, is it possible to do data exchanging between server and client?
Yes! You could use a WebRTC implementation and build your server from the ground up. Will feel like using a HTTP library and setting your own endpoints.
https://github.com/aiortc/aiortc (Python)
GStreamer’s webrtcbin (C)
https://github.com/shinyoshiaki/werift-webrtc (Typescript)
https://github.com/pion/webrtc (Golang)
https://github.com/webrtc-rs/webrtc (Rust)
https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c (C/Embedded)
https://webrtc.googlesource.com/src/ (C++)
https://github.com/rawrtc/rawrtc (C++)
https://github.com/sipsorcery-org/sipsorcery (C#)
https://github.com/paullouisageneau/libdatachannel (C++)
Or you could run a WebRTC server and write an extension/modify it. This will get you something working quicker.
https://github.com/meetecho/janus-gateway
https://github.com/jitsi/jitsi-meet
https://github.com/versatica/mediasoup
https://github.com/pion/ion-sfu
https://galene.org
https://github.com/peer-calls/peer-calls
Happy to answer more directed questions. I think it depends on what languages/tools you feel comfortable with.

Getting access to Mesibo video and audio stream from outside a browser (i.e on a server)

I would like to process audio and video from a Mesibo conference on the server side and then, if possible, feed the processed stream back in as a new publisher (participant) in a different group (conference).
By current best guess would be something like this...
Run the Mesibo Javascript API in a virtual browser using node browser-run and Xvfb
Connect to the conference in the browser and somehow extract the necessary WebRTC connection details and feed this back to the node process controlling the virtual browser
Connect to the conference using node webrtc-client
Having to run a virtual browser every time seems like overkill. Also I have no idea where I would get the webrtc connection details (step 2) from in the virtual browser. Does the Mesibo Javascript API expose these anywhere?
Assumedly if I could get the above working then I could use the same webrtc-client instance to feed the process back into the conference, but if I wanted to feed it into a different conference then I'd have to create another virtual browser.
Anybody got any ideas?
mesibo on-premise conference server exposes RTP API, possibly that should help. However, the on-premise conference server will be available publicly in Feb'21 so you will have to wait.
How would you expect step 2? are you looking to access the underlying peerconnection?

Receiving Leap data from WebSocket server to Unity3D directly

I try to make connection between Leap Motion and mobile devices in Unity3D, via node.js.
Here are two examples I found online using node.js, this and this.
Now, I have successfully receive data from Leap Motion in this procedure:
Receiving JSON-formatted messages from "localhost:6437" in node.js
Parsing and Writing received data on another port (I use "localhost:8000") in node.js
Reading stream from port: 8000 in Unity3D
However, I wonder if it's possible to receive data DIRECTLY from "localhost:6437"? then maybe node.js is not needed.
I have tried to write in C# using TcpClient, but when I check "NetworkStream.DataAvailable", it returns false.
Thanks for your help.
For that you would need a WebSocket client, not a TCP client.

Flex/Air secure client-server communication

I am looking at ways to implement a safe client-server communication via HTTPService requests in Flex/Air. The server side is implemented in PHP, whereas the client could be running on a desktop (Air) or on a browser (flex).
The simply usecase that I need help to secure is -
Desktop client sends a request to the server and gets a response
How can I ensure at the server side that the request is being sent from a valid client? From what I could research, Flex doesn't allow for manipulation of request headers so I am failing to manipulate them. All request queries can be seen by using any network monitor, so having a unique (yet static) parameter won't really hit what I am trying to achieve.
On the other hand, the server can be mimicked by simply manipulating the hosts file. At the client end, how can I ensure that I am receiving the response from the actual server and not from an alias added to hosts file
My solution is to encrypt and decrypt data on the both sides.
In the Air data you need to send should be encrypted with as3crypto and send to server where PHP whould decrypt it, Look here in the last post for the working code example decrypt a as3crypto encrypted text in PHP, you can do the same in case of server to client communation.
So you need to keep same Key and IV for both server and client sides, To be more secure you can embed them as binary data in the project http://www.ghostwire.com/blog/archives/as3-embedding-binary-xml/, it's wouldn't be easily viewable for AS3 decompilers, but anyway take for the notice that it might be hacked by the advanced guys.

Is it possible to connect Node.js and RED5?

I have the following problem.
I have a chat developed with ActionScript3 (AS3), SharedObjects (SO) and RED5. Well, this works correctly. Now, I'm developing a chat using Node.js, and this works correctly too.
My question/problem is how can I connect these 2 chats. Is it possible to send messages between Node.js and RED5? I want that one user that is chatting using Node.js chat and another user that is chatting using RED5 chat, can chat together.
Someone knows some solution? It's possible?
You need to code some server side servlet in Java to proxy your Node.js messages to and from the red5 chat.
Are you familiar with the Red5 API and have some understanding of the Java Servlet Container ? Cause you will need that to implement a solution.
Red5 is a server side technology that runs in the Tomcat Servlet Container. Propably Node.js could send a message to red5 via a simple servlet, that will then forward the message to all connected clients.
The other way round you could catch all chat messages on Red5 server side and then forward the messages to Node.js (however I don't know what incoming message receiver's you can code in Node.js).
Sebastian

Resources