Reverse Engineering HTTP API between iOS device and wifi device on same network - api

I have a device that connects wirelessly to my network. This deivce has a dedicated iOS app but it hasnt been updated in a while and I worry it is no longer supported/updated and therefore it will eventually stop working.
What I would like to do it try to capture the data between the app and the device and reverse engineer the API so write my own app.
I can see that the device has port 8080 open so I am hoping that it is a HTTP based API but on a non standard port.
Ive looked and both Fiddler and Postman but cant quite seem to work out whether their proxy will capture the data from from port 8080 or just 80/443.
Any thoughts how to do this?
Thanks

Related

WebRTC Video Streaming fails through Airtel Broadband, works fine with 4G Hotspot

I am trying out the WebRTC examples of MuazKhan. It is working perfectly fine when the broadcaster is on AWS/Azure(or any other network) and the receiver is through my phones 4G network. But as soon as I switch to my broadband from 4G, the video stream is unable to connect and I the video player keeps on trying. Therefore I assumed that the problem is of the router NATting and will be resolved if I use a tried-n-tested TURN service such as Xirsys.
Sadly, even after using their TURN servers, I still am blocked with my broadband connection issue as mentioned above. Here are a few queries that I wanted to discuss:-
This issue seems to be due to NATting through my broadbands routers. Shouldn't using the TURN server solve it?
How can I verify if even the TURN servers are getting used and its not just the STUN servers.
Can this issue be due to the Signalling Server?
Do i need to enable some specific protocols in my router to make this work?
What else could be responsible for the issue that I should debug?

Calling a web server on my computer from a smartphone

I have this strange problem that i haven't been able to figure out. Can anyone please suggest what to try:
I have a piece of software to control my camera from my computer. It's called "Control my Nikon". It has a built-in web server. The purpose is to be able to connect from a smartphone to use it as a remote control. You choose what port it should listen to and enable it. You get a simple interface with buttons. Exposing a photo, for example, triggers the URL 127.0.0.1:8090/?c=3. Very basic stuff.
On the computer it works perfectly, but from my phone, i just get a timeout. I figured i needed to open the port (8090) in my firewall and spent some time setting that up, but it still won't work. I am using my computer's IP address on the network: 192.168.1.214:8090, which should reach the same place as 127.0.0.1:8090 from the computer.
I then set up a Spring boot application to listen to the 8090 port and i was able to reach that from the phone just fine. This suggests that the firewall is not the issue. I can trigger the control my Nikon URL from within the Spring boot application too, by making a call to http://127.0.0.1:8090/?c=3. I can also reach pages served by Apache (192.168.1.214/testpage.html) on the computer from the phone without any problems.
What am i missing here?
The Nikon software is probably binding itself to the 127.0.0.1 network interface and not every network interface it finds.
The software doesn't appear to be designed for network control but just runs a web server so it can present a UI in HTML.
You would need to change the Nikon software so it listens on other ports (or configure port forwarding or a reverse proxy).

PubNub WebRTC demo working in same network but not over internet (even after established connection)

I was going through this PubNub WebRTC demo. https://kevingleason.me/SimpleRTC/minivid.html
Which works fine within same network (same browser or different devices across same network). But I tried using it over internet, I am able to connect a call but can not see anything but a black screen. This is the source for same tutorial
https://github.com/pubnub/SimpleRTC
I have gone through many such application, such as AndroidRTC
and I face same problem (black screen after connection over internet). I am unable to figure out why, any help is appreciated.
You need some sort of signaling mechanism (PubNub, Firebase, or your own software [nodejs seems the preferred choice these days]) to get the webRTC API communicating P2P on your local network. To get webRTC to work from one network to another you need a STUN server/service. Google provides free stun servers (stun:stun.l.google.com:19302). To get webRTC to traverse strict firewall settings and complicated networks you need a TURN server/service like xirsys.com.
This article covers it all ...
http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/

Get a stream of a remote camera

I need to start a live stream in a remote computer connected to a webcam,
then connect to that remote ip address and see the live stream, like a security webcam more or less.
On my client i want to be able to see the stream in my browser.
What I've tried so far:
VLC on the remote pc: I start the stream (MMS, HTTP or RSTP) and then I encapsulate the stream as object in a html page.
This works, but I have a high latency and not all the browsers support x-vlc-plugin.
WebRTC. This seemed to me the best solution. Direct stream, very low latency.
I tried all the solutions I found in internet, that also integrate node.js. I tried also to build some code myself but the problem is that:
I start the stream on the "server", the remote pc.
When i go to the client, I type in the browser the ip address and port of the remote PC. In theory I should be able to see the REMOTE stream, but instead the browser asks for permission to use my LOCAL camera!
Do you have some hints or solutions about? What am I doing wrong?
Last project I tried:
https://github.com/xat/webcam-binaryjs-demo
In this project:
https://webrtc.github.io/samples/src/content/peerconnection/multiple-relay/
the developer uses a relay of the stream.
Buttons work but I don't know how to use this, that is how to catch the relay and display it on the client.
Thank you for your suggestions.
webRTC has three common API
getUserMedia : for communication and streaming between camera/mic with browser (request permission for access to camera/mic)
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia
RTCDataChannel : data channel for send/receive any type of data on connection
https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel
RTCPeerConnection : for creating peer-to-peer connection
https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection
you don't need getUserMedia
find getUserMedia() , this method send access request for camera and microphone to user , you can set both boolean false , or remove it carefully
navigator.getUserMedia({
video:false,
audio:true,
},function(mediaStream){...

UDP Hole punching unsuccessful, but tests show it should work (mobile network)

For the past two week I have been unsuccessfully trying to implement udp hole punching, but I'm not sure why. I understand that the algorithm for hole punching is not guaranteed to work, but I believe it should work in my test case because I have noticed that once I bind my socket on my home-network, the port is the same to the outside world as it is locally, and stays that way for all connections made from this socket. Any help after reviewing my trials would be appreciated.
I have three computers, my osx desktop, my iPhone, and my amazon ec2 ami.
on the desktop I've built a cocoa app which uses the GCDAsyncUDPSocket library to bind a port and contact the ec2 server, where a java app using apache's mina library stores the sockets external ip/port and associates it with a username passed in the payload.
the iphone, which is on the AT&T network runs an app which uses the same GCDAsyncUDPSocket library to contact the ec2 server with the same username, which then the ec2 does a lookup for the username, finds the desktops info and informs the desktop of the iphones address and the iphone of the desktops address.
now the iphone & the desktop know about each other they start shooting off packets at each other in hopes to get a punched hole.
in theory this should work, but maybe I am missing something about mobile networks that would make this difficult? But then again running a simple udp echoer on a 4th external computer to manually msg the desktop did not work either, so maybe its my router, but I don't see how that could be as all my tests show that the port the desktop asks for is the same one assigned by the router.
I've been at this for nearly two weeks with little progress and any tips would be appreciated!
"once I bind my socket on my home-network, the port is the same to the outside world as it is locally"
I highly doubt that. To traverse NAT given peers A and B which have sent datagrams to a 3rd party: S you need to send datagrams from A to B and vice versa using their public IPs as seen by S and their port as seen by S (i.e. not the port A, B are bound to from their point of view).