Skip to content

Commit

Permalink
Create HighlightListenerPort.bambda
Browse files Browse the repository at this point in the history
Just a highlighter in case you use more listener ports.
  • Loading branch information
Bogo-6 committed Feb 22, 2024
1 parent 5455561 commit 6766293
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Proxy/HTTP/HighlightListenerPort.bambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Highlight different listener port
* @author Bogo-6 (https://github.com/Bogo-6)
**/

boolean manualColorHighlightEnabled = true;

var listenerPort = requestResponse.listenerPort();


if (listenerPort == 8080) {
if (manualColorHighlightEnabled){
requestResponse.annotations().setHighlightColor(HighlightColor.BLUE);

//Optionally, add a note to the request.
requestResponse.annotations().setNotes("User 1");
}
return true;
}

if (listenerPort == 8082) {
if (manualColorHighlightEnabled){
requestResponse.annotations().setHighlightColor(HighlightColor.YELLOW);

//Optionally, add a note to the request.
requestResponse.annotations().setNotes("User 2");
}
return true;
}

return false;

0 comments on commit 6766293

Please sign in to comment.