简体   繁体   中英

Using WinHTTP to transfer data without headers

I am trying to incorporate some SSL/TLS into some Windows Sockets. I can't find any good examples so right now I am looking into the WinHTTP API.

I am wondering if this can be used like traditional socket send() and recv() functionality? I found an example of some code from Windows here:

https://github.com/Microsoft/Windows-classic-samples/blob/master/Samples/WinhttpWebsocket/cpp/WinhttpWebsocket.cpp

I have compiled it and tested using nc and I am getting the HTTP Headers printed to the command prompt. I don't need any of those headers as I want to create my own protocol and send my own data. Is it possible to not use those headers and not use any kind of GET/POST keywords and just treat this as normal socket operations?

Or should I be looking somewhere else? I don't want to use OpenSSL or any 3rd party libraries.

WinHTTP was developed as a light-weight HTTP library to replace WinINet in service applications. It is basically WinINet without FTP/Gopher support and no user preferences.

I doubt WinHTTP allows you to perform connections that are not based on the HTTP protocol, you need to go to a lower layer like SChannel for example. SChannel supports SSL and TLS.

The Windows SDK used to have a SSPI example .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM