AppRTCDemo
AppRTCDemo copied to clipboard
How can I set Jabber server address?
@YK-Unit :I had Stun&Turn server、customer accounts,but I can't see each other when I login in AppRTCDemo 。I think I had problem with Jabber server address in code. Can U tell me what can I do? I had sent mail to u,can u replay my question?It's emergency to me。 thank u very much !
You can do the set in the method - (NSArray *)getLastICEServers
in RTCWorker.m
- (NSArray *)getLastICEServers
{
NSMutableArray *ICEServers = [NSMutableArray array];
#warning - set yourself STUN/TURN servers.\
If have none, you ONLY have p2p RTC in the SAME LAN
//if you have a TURN server ,then add it to ICEServers like this
/*
NSString *url = @"turn:192.168.10.10:3478";
NSString *username = @"name";
NSString *credential = @"pwd";
RTCICEServer *ICEServer = [[RTCICEServer alloc] initWithURI:[NSURL URLWithString:url]username:username password:credential];
[ICEServers addObject:ICEServer];
*/
return ICEServers;
}
-
(NSArray *)getLastICEServers {
NSMutableArray *ICEServers = [NSMutableArray array];
#warning - set yourself STUN/TURN servers.
If have none, you ONLY have p2p RTC in the SAME LAN
//if you have a TURN server ,then add it to ICEServers like this
/*
NSString *url = @"turn:192.168.10.10:3478";
NSString *username = @"name";
NSString *credential = @"pwd";
RTCICEServer *ICEServer = [[RTCICEServer alloc] initWithURI:[NSURL URLWithString:url]username:username password:credential];
[ICEServers addObject:ICEServer];
*/
//stun server
NSString *url_stun = @"stun:stun.stunprotocol.org";//stun:stun.stunprotocol.org:19302
NSString *username_stun = @"";
NSString *credential_stun = @"";
RTCICEServer *ICEServer_stun = [[RTCICEServer alloc] initWithURI:[NSURL URLWithString:url_stun]username:username_stun password:credential_stun];
[ICEServers addObject:ICEServer_stun];
//turn server
NSString *url = @"turn:54.210.36.188:3478";
NSString *username = @"test";
NSString *credential = @"test123";
RTCICEServer *ICEServer = [[RTCICEServer alloc] initWithURI:[NSURL URLWithString:url]username:username password:credential];
[ICEServers addObject:ICEServer];
//jabber server
NSString *url_Jabber = @"chatme.im";
NSString *username_Jabber = @"";
NSString *credential_Jabber = @"";
RTCICEServer *ICEServer_Jabber = [[RTCICEServer alloc] initWithURI:[NSURL URLWithString:url_Jabber]username:username_Jabber password:credential_Jabber];
[ICEServers addObject:ICEServer_Jabber];
return ICEServers;
}
I use Chatme.im的jabber. I register two accounts,just like [email protected],[email protected]; can u help me to check the stun、turn&Jabber servers are correct? plz...
@YK-Unit :take a look,Plz. Thank u very much