Community Forum

Help regarding api connect

hai all

i tried to connect to a device using below code

var settings = {
  "url": "",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "host": "",
    "content-type": "application/json"
  "data": JSON.stringify({
    "deviceaddress": "80:00:00:00:XX:XX:XX:XX",
    "wait": "true",
    "hostip": ""

$.ajax(settings).done(function (response) {

and response is like below

{"status":"true","connection":{"deviceaddress":"80:00:00:00:XX:XX:XX:XX","status":"running","requested":"11\/17\/2021T8:36 PM","proxy":"http:\/\/","proxyserver":"","proxyport":"31452","expirationsec":"28800","connectionid":"c48db86f-8d68-XXXXXXXXXXXXXXXXXXXXXX","proxyServerPort":31452,"proxyExpirationSec":28800,"sessionID":"980B668E923C87A8DB66FEDA9B8881C3F38946BF","initiator":"","targetUID":"80:00:00:00:XX:XX:XX:XX","clientID":"N0JGMjU3QUItRjA2Qy00QzJDLUEyNUEtMTXXXXXXXXXXXXXX","filteredIP":"none","proxyURL":"","reverseProxy":false,"p2pConnected":true,"serviceConnected":true,"peerReqEP":"XX.XXX.120.184:XXXXX","peerEP":"49.XXX.120.184:XXXXX","latchedIP":"","initiatorUID":"f0:80:5f:2a:f0:86:e8:xx","lifeLeft":86396,"idleLeft":896,"requestedAt":"2021-11-18T01:36:00+00:00"},"wait":true,"connectionid":"c48db86f-8d68-4617-8614-xxxxxxxxxxxx"}

but video is not streaming with api but if i connect with the website connect button in Devices section all works perfect

i am i missing any thing else in api

What is the proxy connection host you are getting in the web portal vs. the API call?

e.g. proxy61, etc.



thanks for your fast response

from web portal the proxy url is its working normal
but again from api call proxy url is connecting and disconnecting not wrking

is that an issue getting like that

can any one help me with this issue please

Sorry I missed this. It will be faster if you send an e-mail to because I need to ask you to do the test/comparison again.

I don’t see anything obviously wrong in what you are doing. Is the pattern consistent? Do you always get the same proxy (if not the same port) via the API?

The reality though is that if you are trying to stream video, making a proxy connection is not the best way to do that. You should try to make peer to peer connections if possible. This usually gives best performance.

Please see: