问题
I have a C++ Linux server listening on port 3600 for a connection from a flash client. This server manages game logic as well as chat functionality between clients. I'm in the process of putting my flash client up on the web and using Facebook login to keep track of users # of games played and such.
I have an Apache server that sends out the index.html with the embedded SWF.
The problem I am facing is that I need the Facebook token in my C++ server. From what I have figured out on the Facebook authentication documentation is that after I have redirected the user and they login, the user will be redirected to a URI specified by me and will have the data my server needs to get a token and make facebook API calls.
So my question is: How do I have a C++ server listening for an HTTP sent by facebook on a certain URL? I know HTTP is sent on port 80, but I'm not sure how to only listen for specific URL's. Also I don't think I can have Apache listening on port 80 and have a second application trying to listen on port 80 also.
Do I need to scrap Apache and have my C++ server send out my index.html file as well as listen for requests on port 80? I looked through libcurl but didn't see anything about listening for certain URL's.
I've been digging through content for hours and can't find the information I need. Hopefully someone out there can set me on the right path!
Thanks for any help.
来源:https://stackoverflow.com/questions/11946136/c-linux-server-getting-facebook-http-authentication-message