0

I've been working on an app that bridges http calls over an established tunnel between two JID's. I have my tunneling setup correctly, but I cannot figure out how I'm supposed to use the HttpServer to serve requests. Using talk_base::HttpListenServer I can accept connections:

server.Listen(talk_base::SocketAddress("127.0.0.1", 59000));

But even after attaching a signal:

server.SignalHttpRequest.connect(this, &TunnelManager::HandleTouchRequest);

I have no idea how I'm supposed to respond to the requests. At this point, the requests just hang after connecting with no apparent signals being called. I was wondering if there are any better resources, possibly code examples, for me to look at to get a working http server?

Zack
  • 1,181
  • 2
  • 11
  • 26
  • What platform are you building for? And have you looked at the peerconnection examples shipped with the libjingle code? That example uses http (long polling if I remember correctly) to send the client's SDP and ICE information. – AeroBuffalo May 17 '13 at 11:54
  • I'm building on ios and osx. I've looked at the peer connection example and it seems to be setting itself up in the same way. However, I did happen to figure out what the problem was (or at least the solution). Replied below. – Zack May 17 '13 at 16:37

1 Answers1

0

So it looks like there might be a problem with using the PhysicalSocketServer on OSX instead of the platform specific wrapper. Setting up the correct socket server before anything else fixed the problem. Apparently my usage above is correct.

talk_base::Thread::Current()->set_socketserver(new talk_base::MacCFSocketServer());

This appears to have fixed problems with the HttpClient as well.

Zack
  • 1,181
  • 2
  • 11
  • 26