-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
187 lines (179 loc) · 10 KB
/
index.html
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>p5 Net Proxy</title>
<!-- https://electronjs.org/docs/tutorial/security#csp-meta-tag -->
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<link rel="stylesheet" href="contents/style.css" />
<link rel="stylesheet" href="node_modules/@fortawesome/fontawesome-free/css/all.min.css"
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="./contents/bootstrap.min.css" />
<link rel="stylesheet" href="./contents/bootstrap4-toggle.min.css" />
<!-- Bootstrap Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script>let $ = require('jquery');</script>
<script>require('popper.js');</script>
<script>require('bootstrap');</script>
</head>
<body>
<div id="menu" class="overflow-hidden">
<ul class="nav flex-colum">
<li class="nav-item">
<a class="nav-item nav-link" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">
<button type="button" class="btn btn-primary">
<i class="fas fa-network-wired"></i>
net traffic
</button>
</a>
</li>
<li class="nav-item">
<a class="nav-item nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">
<button type="button" class="btn btn-primary">
<i class="fas fa-cogs"></i>
Settings
</button>
</a>
</li>
<li class="nav-item">
<a class="nav-item nav-link" id="nav-contact-tab" data-toggle="tab" href="#nav-contact" role="tab" aria-controls="nav-contact" aria-selected="false">
<button type="button" class="btn btn-primary">
<i class="fas fa-keyboard"></i>
Send
</button>
</a>
</li>
</ul>
</div>
<div id="detail">
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">
<div class="container">
<h1>Log </h1>
<div class="container text-right">
<button type="button" class="btn btn-primary btn-sm" onclick="clearLog()">Clear Log</button>
<button type="button" id="toggleLog" class="btn btn-primary btn-sm" onclick="toggleLog()">Disable Log</button>
</div>
<table class="table table-striped" id="logTable">
<thead>
<tr>
<th scope="col">To:</th>
<th scope="col">From:</th>
<th scope="col">Data:</th>
</tr>
</thead>
<tbody id="logTableBody">
</tbody>
</table>
</div>
</div> <!-- end of tab log-->
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">
<div class="container overflow-auto">
<h1>Settings</h1>
<h2><i class="fas fa-plug"></i> WebSocket</h2>
<div class="form-group">
<label for="portNumber">Port number</label>
<input type="number" class="form-control" id="ws_port" length="7" aria-describedby="portNumberHelp" value="9000">
</div>
<div class="text-right">
<button class="btn btn-primary" id="ws_open" onclick="openWebsocket($('#ws_port').val())">Open WebSocket</button>
<button class="btn btn-primary" id="ws_close" onclick="closeWebsocket()">Close Websocket</button>
</div>
<hr />
<div id="connections" class="text-right">
<button class="btn btn-primary" id="newConn" data-toggle="modal" data-target="#exampleModal">New UDP/TCP Connection</button>
</div>
<table class="table" id="connectionTable">
<thead>
<tr>
<th scope="col">Protocol</th>
<th scope="col">IP Address</th>
<th scope="col">Port number</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Create New Connection</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>
Create a UDP or TCP connection - the Proxy will kepp the connection until you close it. any traffic will be sent to the websocket.
</p>
<form>
<div class="form-group">
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="inputGroupSelect01">Protocol</label>
</div>
<select class="custom-select" id="newConnectionProtocol">
<option value="UDP" selected>UDP</option>
<option value="TCP">TCP</option>
</select>
</div>
</div>
<div class="form-group">
<label for="formGroupExampleInput">IP Address</label>
<input type="text" class="form-control" id="newConnectionIP" placeholder="the IP address you want to connect to">
</div>
<div class="form-group">
<label for="formGroupExampleInput">Port number</label>
<input type="text" class="form-control" id="newConnectionPort" placeholder="specify port number">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="newConnection($('#newConnectionProtocol').val(), $('#newConnectionIP').val(), $('#newConnectionPort').val() )">Save changes</button>
</div>
</div>
</div>
</div>
</div>
</div> <!-- end of tab settings-->
<div class="tab-pane fade" id="nav-contact" role="tabpanel" aria-labelledby="nav-contact-tab">
<div class="container">
<h1>Send Data</h1>
<p>
not supported yet! <br/>
Soon you can send data from your list of connections....
</p>
<!--<form>
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Check me out</label>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>-->
</div>
</div>
</div>
</div>
<script src="./proxy.js" />
<script>
$(function(){
$('#btn').click(function() {
alert("Hello");
});
$('[data-toggle="tooltip"]').tooltip();
$('#toggle-log').bootstrapToggle();
});
</script>
</body>
</html>