Home Help Center

get client's IP using glacier2router

AndrewAndrew Member Andrea NicotraOrganization: PersonalProject: Backend for IPTV
hi ,

how Ice server can get the ICE client's IP if i use glacier2router?

Andrew

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    You would have to send it as part of a request. There is no way to find out the IP address implicitly. In general, I would be careful with any design that relies on having to know the client's IP address other than for debug purposes. What do you need it for?
  • AndrewAndrew Member Andrea NicotraOrganization: PersonalProject: Backend for IPTV
    because i want send the client ip to another client , i want to use the server like a ip triangolator .

    i obtain the ip of client call the current.con->toString() from a callback, have another idea?
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    What does the other client do with the IP address? If you want the two clients to communicate with each other directly, then the usual way to do this is to send a proxy from one client to the other over the server. The proxy embeds the IP address and any additional information that is required to reach the client.
  • AndrewAndrew Member Andrea NicotraOrganization: PersonalProject: Backend for IPTV
    i have patch the source code of Glacier2 :

    in SessionRouterI.cpp:
    function : virtual void createSession()
    I add that:
     		string str(_current.con->toString());
    		string key("remote address = ");
    		size_t start(str.rfind(key));
    	
    		if(start != string::npos)
    		{
    			str = str.substr(start + key.length());
    			str = str.substr(0, str.find_first_of(":")) ;
    		}
    		else
    			str = "";
    
    		map<string, string> contextMap;
    		contextMap["remote"]=str;
    
            _sessionRouter->_sessionManager->create_async(new CreateCB(this), _user, _control, contextMap );//_current.ctx);
    
Sign In or Register to comment.