**reading url from browser using qt** -
i'm trying develop application listens specific port (for example 9999) in localhost. how retrieve url when user types <127.0.0.1:9999/somedir> in web browser?
to retrieve url have implement pieces of http protocol.
this official documentation of http protocol.
if want path of entered url, can parse of request data. following example of http request made browser:
get /index.html http/1.1 host: www.example.com
the first word @ first line command performed. next, path @ server, , protocol , version. next line (at example) specify host. used example server provide many web sites. feature called virtual host.
it important note each line of http request , response separated \r\n
characters.
take @ http protocol on wikipedia. start implement basic functionality.
Comments
Post a Comment