summaryrefslogtreecommitdiff
path: root/example
AgeCommit message (Collapse)Author
2023-11-11Makefile: replace the Go linter and apply all their recommendationsShulhan
Previously, we use golangci-lint as linter. This linter does not provides any useful recommendation lately and the development is quite a mess, sometimes its break when using Go tip. In this changes we replace it with revive, fieldalignment, and shadow; and fix all of their recommendations.
2022-08-21example: fix the HTTP POST handlerShulhan
Remove call to ParseMultipartform since the request type is x-www-form-urlencoded not multipart/form-data.
2022-08-21all: remove trailing new line on each mlog formatShulhan
The mlog functions automatically add new line to each format, so we did not need to add it manually.
2022-08-21all: fix all linter warningsShulhan
Some linter, govet, warns about possible copied Mutex on HttpRequest. To fix this we implement method clone and Stringer on HttpRequest.
2022-08-21all: reformat with Go 1.19 gofmtShulhan
2022-03-14all: changes the license of trunks software to GPL 3.0 or laterShulhan
See https://kilabit.info/journal/2022/gpl for more information.
2022-01-10all: update share and ciigo modulesShulhan
2021-12-21all: add option to open link inside an iframeShulhan
The NavLink struct now has field OpenInIFrame. If its true, the Href will be opened inside an iframe in the same window, otherwise it will opened in new tab.
2021-12-21all: add feature to register custom navigation linkShulhan
Using Trunks.RegisterNavLink, one can register custom link into left navigation menu.
2021-10-18all: rename internal/cmd/trunks-example to internal/cmd/trunksShulhan
The internal/cmd/trunks-example is not run and provide an example only now, its include the workers to build, recompile, re-embeded files.
2021-10-17all: move the main program for example to internal/cmd/trunks-exampleShulhan
The "cmd" directory on module should be reserved for installable program that can be executed outside of this repository. The trunks-example is development server should be run on root of this repository only, not installable to $GOBIN.
2021-09-28www: group related fields to use fieldset instead of headerShulhan
Currently we are experimenting changing the layout for grouping input fields from flat layout into fieldset, so user can see more separation between each sub-section.
2021-09-26all: unembed HTTP server on TrunksShulhan
Since we will implement API using WebSocket later, we need to split between the one that manage HTTP and one that manage WebSocket.
2021-09-25example: return all response like HTTP Request in JSON formatShulhan
The endpoint for GET and POST examples now return the object like HTTP Request which contains the HTTP Method, URL, Headers, Form, MultipartForm, and the Body. This will allow us to inspect the request with logging in to console.
2021-09-25all: prevent leaking Target and HttpTarget headers and variablesShulhan
In case two or more users access the Trunks web and set the target variables, the last user that run any HttpTarget will set the Target variables or HttpTarget headers/variables. The next user that open the Trunks web will see the values of headers and variables from the latest run. This changes fix this issue by generating new RunRequest using request original target
2021-09-19all: display notification on failed or success RunShulhan
Previously, after clicking the "Run" button user need to inspect the "Run output" to check if the request is success or fail. This changes, display a notification everytime the "Run" finished. It will display the notification as error or success based on the HttpStatusCode inside the RunResponse
2021-09-19all: add option to set description (Hint) on any inputs elementShulhan
This changes refactor the KeyValue from map[string]string into map[string]FormInput, where FormInput is a struct with Label, Hint, Kind, Value, Max, and Min. With the available of Hint field, the web user interface can render it as description of input. This changes also make all input hint to be displayed on the first render.
2021-09-18all: add "Hint" for Target, HTTP, and WebSocket TargetShulhan
The "Hint" provide a general description for Target, a single HttpTarget, and WebSocketTarget.
2021-04-09all: change the WebSocket run return type to interface{}Shulhan
Instead of []byte, the call to Run on WebSocketTarget can return anything, since we will wrap it inside the EndpointRequest.Data later.
2021-03-27all: change the Run result to return dump of HTTP request and responseShulhan
Previously, we display the actual response of the HTTP target only on the user interface. This changes make the Run function to display the actual HTTP request and response that being send and received on HTTP target.
2021-03-27all: allow client to customize request method, path, and typeShulhan
Previously, the HttpTarget Method, Path, and RequestType is fixed. Once its declared, the Run method will use the defined values to generate and call HTTP request. This changes add IsCustomizable field on HttpTarget. If its true, client or web user interface can modify the request method, path, and type. The values send by client to server after changes will be used instead of the fixed values. This changes also make the Run handler on HttpTarget to be optional. If its not defined, it will generated the HTTP request from the method, path, and type passed to server.
2021-03-24all: fix and update linter warningsShulhan
Check for error where it should and remove unused return and methods.
2021-03-24all: implement target for WebSocketShulhan
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.
2021-03-24all: move BaseUrl from AttackOptions to TargetShulhan
The BaseUrl seems like not a good fit on AttackOptions since its should never changes, so we move it to the Target.
2021-03-21all: implement interface and API to cancel running attackShulhan
On the top of the page, it will display currently running attack with target name and HTTP target name. User can cancel the attack by clicking "Cancel" button on the right.
2021-03-21all: load pass attack results and implement function to get attack resultShulhan
When the service started, it will load all previous attack results from directory Environment.ResultsDir. It will only scan the file name and append it to HttpTarget.Results due to the size and time to load one of them can take time. Through the web interface, user can click "Show" button to load the result and display it on the screen.
2021-03-21all: various changesShulhan
* Increase the DEBUG value to 3 to match with latest libhttp fix debug output of client request * _www: fix rendering HTTP headers, missing "target" parameter * Remove unused "IsRunning" from AttackResult * example: add an example endpoint for POST with x-www-form-urlencoded * Remove parameter Target on HttpRunHandler. The Target value can be retrieved from RunRequest.Target. * Target: change the field Vars type from map[string]string to KeyValue * Trunks: merge Target and HttpRequest from request to original Target and HttpTarget respectively before calling Run * Prefix the result file name with Target.ID * Move the package documentation to doc.go
2021-03-21all: implement API and interface for attack functionalityShulhan
When the user click "Attack" it will call the API to run the load testing. If there is load testing currently, it will return with an error. On success, the result of load testing will be stored on directory defined in Environment.ResultsDir with file named <HttpTarget.ID>.<date_time>.<RPS>x<Duration>s.<ResultsSuffix>.bin This file contains the vegeta.Results.
2021-03-15trunks: a module for testing HTTP servicesShulhan
Trunks is a library and HTTP service that provide web user interface to test HTTP service, similar to Postman, and for load testing. For the load testing we use vegeta [1] as the backend. [1] https://github.com/tsenart/vegeta