Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.51
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
net /
http /
[ HOME SHELL ]
Name
Size
Permission
Action
cgi
[ DIR ]
drwxr-xr-x
cookiejar
[ DIR ]
drwxr-xr-x
fcgi
[ DIR ]
drwxr-xr-x
httptest
[ DIR ]
drwxr-xr-x
httptrace
[ DIR ]
drwxr-xr-x
httputil
[ DIR ]
drwxr-xr-x
internal
[ DIR ]
drwxr-xr-x
pprof
[ DIR ]
drwxr-xr-x
testdata
[ DIR ]
drwxr-xr-x
alpn_test.go
3.03
KB
-rw-r--r--
client.go
31.47
KB
-rw-r--r--
client_test.go
55.36
KB
-rw-r--r--
clientserver_test.go
42.36
KB
-rw-r--r--
clone.go
1.56
KB
-rw-r--r--
cookie.go
10.76
KB
-rw-r--r--
cookie_test.go
17.74
KB
-rw-r--r--
doc.go
3.44
KB
-rw-r--r--
example_filesystem_test.go
2.03
KB
-rw-r--r--
example_handle_test.go
560
B
-rw-r--r--
example_test.go
5.28
KB
-rw-r--r--
export_test.go
7.43
KB
-rw-r--r--
filetransport.go
2.9
KB
-rw-r--r--
filetransport_test.go
1.61
KB
-rw-r--r--
fs.go
23.36
KB
-rw-r--r--
fs_test.go
35.21
KB
-rw-r--r--
h2_bundle.go
320.65
KB
-rw-r--r--
header.go
7.36
KB
-rw-r--r--
header_test.go
5.58
KB
-rw-r--r--
http.go
4.95
KB
-rw-r--r--
http_test.go
4.43
KB
-rw-r--r--
jar.go
900
B
-rw-r--r--
main_test.go
4.41
KB
-rw-r--r--
method.go
517
B
-rw-r--r--
omithttp2.go
1.85
KB
-rw-r--r--
proxy_test.go
1.13
KB
-rw-r--r--
range_test.go
2.38
KB
-rw-r--r--
readrequest_test.go
9.71
KB
-rw-r--r--
request.go
44.68
KB
-rw-r--r--
request_test.go
31.96
KB
-rw-r--r--
requestwrite_test.go
22.79
KB
-rw-r--r--
response.go
10.76
KB
-rw-r--r--
response_test.go
24.05
KB
-rw-r--r--
responsewrite_test.go
6.94
KB
-rw-r--r--
roundtrip.go
563
B
-rw-r--r--
roundtrip_js.go
9.11
KB
-rw-r--r--
serve_test.go
171.18
KB
-rw-r--r--
server.go
105.67
KB
-rw-r--r--
server_test.go
1.19
KB
-rw-r--r--
sniff.go
8
KB
-rw-r--r--
sniff_test.go
8.09
KB
-rw-r--r--
socks_bundle.go
12.93
KB
-rw-r--r--
status.go
7.26
KB
-rw-r--r--
transfer.go
30.3
KB
-rw-r--r--
transfer_test.go
7.31
KB
-rw-r--r--
transport.go
81.6
KB
-rw-r--r--
transport_internal_test.go
5.91
KB
-rw-r--r--
transport_test.go
159.07
KB
-rw-r--r--
triv.go
3.2
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : roundtrip_js.go
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build js,wasm package http import ( "errors" "fmt" "io" "io/ioutil" "strconv" "syscall/js" ) var uint8Array = js.Global().Get("Uint8Array") // jsFetchMode is a Request.Header map key that, if present, // signals that the map entry is actually an option to the Fetch API mode setting. // Valid values are: "cors", "no-cors", "same-origin", "navigate" // The default is "same-origin". // // Reference: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters const jsFetchMode = "js.fetch:mode" // jsFetchCreds is a Request.Header map key that, if present, // signals that the map entry is actually an option to the Fetch API credentials setting. // Valid values are: "omit", "same-origin", "include" // The default is "same-origin". // // Reference: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters const jsFetchCreds = "js.fetch:credentials" // jsFetchRedirect is a Request.Header map key that, if present, // signals that the map entry is actually an option to the Fetch API redirect setting. // Valid values are: "follow", "error", "manual" // The default is "follow". // // Reference: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters const jsFetchRedirect = "js.fetch:redirect" var useFakeNetwork = js.Global().Get("fetch").IsUndefined() // RoundTrip implements the RoundTripper interface using the WHATWG Fetch API. func (t *Transport) RoundTrip(req *Request) (*Response, error) { if useFakeNetwork { return t.roundTrip(req) } ac := js.Global().Get("AbortController") if !ac.IsUndefined() { // Some browsers that support WASM don't necessarily support // the AbortController. See // https://developer.mozilla.org/en-US/docs/Web/API/AbortController#Browser_compatibility. ac = ac.New() } opt := js.Global().Get("Object").New() // See https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch // for options available. opt.Set("method", req.Method) opt.Set("credentials", "same-origin") if h := req.Header.Get(jsFetchCreds); h != "" { opt.Set("credentials", h) req.Header.Del(jsFetchCreds) } if h := req.Header.Get(jsFetchMode); h != "" { opt.Set("mode", h) req.Header.Del(jsFetchMode) } if h := req.Header.Get(jsFetchRedirect); h != "" { opt.Set("redirect", h) req.Header.Del(jsFetchRedirect) } if !ac.IsUndefined() { opt.Set("signal", ac.Get("signal")) } headers := js.Global().Get("Headers").New() for key, values := range req.Header { for _, value := range values { headers.Call("append", key, value) } } opt.Set("headers", headers) if req.Body != nil { // TODO(johanbrandhorst): Stream request body when possible. // See https://bugs.chromium.org/p/chromium/issues/detail?id=688906 for Blink issue. // See https://bugzilla.mozilla.org/show_bug.cgi?id=1387483 for Firefox issue. // See https://github.com/web-platform-tests/wpt/issues/7693 for WHATWG tests issue. // See https://developer.mozilla.org/en-US/docs/Web/API/Streams_API for more details on the Streams API // and browser support. body, err := ioutil.ReadAll(req.Body) if err != nil { req.Body.Close() // RoundTrip must always close the body, including on errors. return nil, err } req.Body.Close() buf := uint8Array.New(len(body)) js.CopyBytesToJS(buf, body) opt.Set("body", buf) } respPromise := js.Global().Call("fetch", req.URL.String(), opt) var ( respCh = make(chan *Response, 1) errCh = make(chan error, 1) ) success := js.FuncOf(func(this js.Value, args []js.Value) interface{} { result := args[0] header := Header{} // https://developer.mozilla.org/en-US/docs/Web/API/Headers/entries headersIt := result.Get("headers").Call("entries") for { n := headersIt.Call("next") if n.Get("done").Bool() { break } pair := n.Get("value") key, value := pair.Index(0).String(), pair.Index(1).String() ck := CanonicalHeaderKey(key) header[ck] = append(header[ck], value) } contentLength := int64(0) if cl, err := strconv.ParseInt(header.Get("Content-Length"), 10, 64); err == nil { contentLength = cl } b := result.Get("body") var body io.ReadCloser // The body is undefined when the browser does not support streaming response bodies (Firefox), // and null in certain error cases, i.e. when the request is blocked because of CORS settings. if !b.IsUndefined() && !b.IsNull() { body = &streamReader{stream: b.Call("getReader")} } else { // Fall back to using ArrayBuffer // https://developer.mozilla.org/en-US/docs/Web/API/Body/arrayBuffer body = &arrayReader{arrayPromise: result.Call("arrayBuffer")} } code := result.Get("status").Int() select { case respCh <- &Response{ Status: fmt.Sprintf("%d %s", code, StatusText(code)), StatusCode: code, Header: header, ContentLength: contentLength, Body: body, Request: req, }: case <-req.Context().Done(): } return nil }) defer success.Release() failure := js.FuncOf(func(this js.Value, args []js.Value) interface{} { err := fmt.Errorf("net/http: fetch() failed: %s", args[0].String()) select { case errCh <- err: case <-req.Context().Done(): } return nil }) defer failure.Release() respPromise.Call("then", success, failure) select { case <-req.Context().Done(): if !ac.IsUndefined() { // Abort the Fetch request ac.Call("abort") } return nil, req.Context().Err() case resp := <-respCh: return resp, nil case err := <-errCh: return nil, err } } var errClosed = errors.New("net/http: reader is closed") // streamReader implements an io.ReadCloser wrapper for ReadableStream. // See https://fetch.spec.whatwg.org/#readablestream for more information. type streamReader struct { pending []byte stream js.Value err error // sticky read error } func (r *streamReader) Read(p []byte) (n int, err error) { if r.err != nil { return 0, r.err } if len(r.pending) == 0 { var ( bCh = make(chan []byte, 1) errCh = make(chan error, 1) ) success := js.FuncOf(func(this js.Value, args []js.Value) interface{} { result := args[0] if result.Get("done").Bool() { errCh <- io.EOF return nil } value := make([]byte, result.Get("value").Get("byteLength").Int()) js.CopyBytesToGo(value, result.Get("value")) bCh <- value return nil }) defer success.Release() failure := js.FuncOf(func(this js.Value, args []js.Value) interface{} { // Assumes it's a TypeError. See // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError // for more information on this type. See // https://streams.spec.whatwg.org/#byob-reader-read for the spec on // the read method. errCh <- errors.New(args[0].Get("message").String()) return nil }) defer failure.Release() r.stream.Call("read").Call("then", success, failure) select { case b := <-bCh: r.pending = b case err := <-errCh: r.err = err return 0, err } } n = copy(p, r.pending) r.pending = r.pending[n:] return n, nil } func (r *streamReader) Close() error { // This ignores any error returned from cancel method. So far, I did not encounter any concrete // situation where reporting the error is meaningful. Most users ignore error from resp.Body.Close(). // If there's a need to report error here, it can be implemented and tested when that need comes up. r.stream.Call("cancel") if r.err == nil { r.err = errClosed } return nil } // arrayReader implements an io.ReadCloser wrapper for ArrayBuffer. // https://developer.mozilla.org/en-US/docs/Web/API/Body/arrayBuffer. type arrayReader struct { arrayPromise js.Value pending []byte read bool err error // sticky read error } func (r *arrayReader) Read(p []byte) (n int, err error) { if r.err != nil { return 0, r.err } if !r.read { r.read = true var ( bCh = make(chan []byte, 1) errCh = make(chan error, 1) ) success := js.FuncOf(func(this js.Value, args []js.Value) interface{} { // Wrap the input ArrayBuffer with a Uint8Array uint8arrayWrapper := uint8Array.New(args[0]) value := make([]byte, uint8arrayWrapper.Get("byteLength").Int()) js.CopyBytesToGo(value, uint8arrayWrapper) bCh <- value return nil }) defer success.Release() failure := js.FuncOf(func(this js.Value, args []js.Value) interface{} { // Assumes it's a TypeError. See // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError // for more information on this type. // See https://fetch.spec.whatwg.org/#concept-body-consume-body for reasons this might error. errCh <- errors.New(args[0].Get("message").String()) return nil }) defer failure.Release() r.arrayPromise.Call("then", success, failure) select { case b := <-bCh: r.pending = b case err := <-errCh: return 0, err } } if len(r.pending) == 0 { return 0, io.EOF } n = copy(p, r.pending) r.pending = r.pending[n:] return n, nil } func (r *arrayReader) Close() error { if r.err == nil { r.err = errClosed } return nil }
Close