FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node/src/inspector_socket.h at main · fetchapi/node · GitHub
fetchapi
/
node
Public
forked from
nodejs/node
Notifications
You must be signed in to change notification settings
Fork
1
Star
0
Code
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
node
/
src
/
inspector_socket.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
60 lines (43 loc) · 1.53 KB
Breadcrumbs
node
/
src
/
inspector_socket.h
Copy path
File metadata and controls
60 lines (43 loc) · 1.53 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
ifndef
SRC_INSPECTOR_SOCKET_H_
#
define
SRC_INSPECTOR_SOCKET_H_
#
if
defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#
include
"
util.h
"
#
include
"
uv.h
"
#
include
<
string
>
#
include
<
vector
>
namespace
node
{
namespace
inspector
{
class
ProtocolHandler
;
//
HTTP Wrapper around a uv_tcp_t
class
InspectorSocket
{
public:
class
Delegate
{
public:
virtual
void
OnHttpGet
(
const
std::string& host,
const
std::string& path) = 0;
virtual
void
OnSocketUpgrade
(
const
std::string& host,
const
std::string& path,
const
std::string& accept_key) = 0;
virtual
void
OnWsFrame
(
const
std::vector<
char
>& frame) = 0;
virtual
~Delegate
() =
default
;
};
using
DelegatePointer = std::unique_ptr<Delegate>;
using
Pointer = std::unique_ptr<InspectorSocket>;
static
Pointer
Accept
(
uv_stream_t
* server, DelegatePointer delegate);
~InspectorSocket
();
void
AcceptUpgrade
(
const
std::string& accept_key);
void
CancelHandshake
();
void
Write
(
const
char
* data,
size_t
len);
void
SwitchProtocol
(ProtocolHandler* handler);
std::string
GetHost
();
InspectorSocket
(
const
InspectorSocket&) =
delete
;
InspectorSocket&
operator
=(
const
InspectorSocket&) =
delete
;
private:
static
void
Shutdown
(ProtocolHandler*);
InspectorSocket
() =
default
;
DeleteFnPtr<ProtocolHandler, Shutdown> protocol_handler_;
};
}
//
namespace inspector
}
//
namespace node
#
endif
//
defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#
endif
//
SRC_INSPECTOR_SOCKET_H_
Back
|
FazBrowse Home
|
New Git URL