diff options
| author | boris <wzn@moneybot.cc> | 2018-12-19 00:13:24 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-12-19 00:13:24 +1300 |
| commit | 77b52da44b263df4884be2f35f885d8edccbb6fa (patch) | |
| tree | 54a9a07c67d507cb5120ae7e4ee86669dfec7c6b /csgo-loader/csgo-server/Networking/WebSocket.hpp | |
| parent | 1270999026bd77165edfffebfce277a34761710c (diff) | |
added new loader project :)
merry christmas
Diffstat (limited to 'csgo-loader/csgo-server/Networking/WebSocket.hpp')
| -rw-r--r-- | csgo-loader/csgo-server/Networking/WebSocket.hpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/csgo-loader/csgo-server/Networking/WebSocket.hpp b/csgo-loader/csgo-server/Networking/WebSocket.hpp new file mode 100644 index 0000000..f503913 --- /dev/null +++ b/csgo-loader/csgo-server/Networking/WebSocket.hpp @@ -0,0 +1,37 @@ +#pragma once
+
+#include <windows.h>
+#include <wininet.h>
+#include <vector>
+#include <algorithm>
+#include <cstdint>
+
+#pragma comment(lib, "wininet.lib")
+
+using ByteArray = std::vector<uint8_t>;
+
+namespace Networking {
+ // Whenever the handle goes out of scope, it will automatically be released.
+ class InternetHandle {
+ HINTERNET m_Internet;
+ public:
+ InternetHandle() = default;
+ InternetHandle(HINTERNET Internet) :
+ m_Internet(Internet) { }
+
+ ~InternetHandle() {
+ InternetCloseHandle(m_Internet);
+ }
+
+ operator HINTERNET() { return m_Internet; };
+ };
+
+ class WebSocket {
+ InternetHandle m_Internet;
+ InternetHandle m_Address;
+
+ public:
+ bool Start(const char *Address, const char *Username, const char *Password);
+ ByteArray Request(const char *File, const char *Header, ByteArray &Data);
+ };
+}
\ No newline at end of file |
