aboutsummaryrefslogtreecommitdiff
path: root/errors.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-03-24 01:56:39 +0700
committerShulhan <ms@kilabit.info>2021-03-24 02:00:47 +0700
commit7035a7fb42b9054657f5a99bb479fd4722d8ae7c (patch)
tree44c5e4d328722a8877082f8b47ca0850dc55702e /errors.go
parent896e55e6406b0837041c0aad75035f5839083e25 (diff)
downloadgorankusu-7035a7fb42b9054657f5a99bb479fd4722d8ae7c.tar.xz
all: implement target for WebSocket
One can register WebSocketTarget just like HttpTarget, its have ID, Name, Headers, and Params. Unlike HTTP, the WebSocket target only able to execute Run, it does not have "Attack", yet.
Diffstat (limited to 'errors.go')
-rw-r--r--errors.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/errors.go b/errors.go
index f5f04b4..2ff3194 100644
--- a/errors.go
+++ b/errors.go
@@ -79,3 +79,14 @@ func errInvalidHttpTarget(id string) error {
}
return res
}
+
+func errInvalidWebSocketTarget(id string) error {
+ res := &libhttp.EndpointResponse{
+ E: liberrors.E{
+ Code: http.StatusBadRequest,
+ Message: fmt.Sprintf("invalid or emtpy WebSocketTarget.ID: %q", id),
+ Name: "ERR_INVALID_WEBSOCKET_TARGET",
+ },
+ }
+ return res
+}