SeaLights Java Agent - Using the Sealights Java Proxy Server
In rare cases where the JVM being run with the Sealights Java Agent has security limitations preventing the communication with Sealights there is the option to set up a Sealights Java Proxy Server process which will relay all the requests through it.
This agent is designed to act as a TLS Inititator rather than a generic Proxy server.
Downloading Agent file
Download it from: https://agents.sealights.co/sl_proxy_server/sl_proxy_server-4.0.2433.zip
Configuration File
Create a configuration file and provide its location using the -Dsl.config.file flag or call it 'slProxyCfg.json' and place it in the current working directory of the JVM running the Java coverage listener.
It should contain the following minimum set of parameters:
token or tokenFile - The token to be used to send the data to SeaLights
proxyServerPort - The port that the proxy should listen on
proxy - (Optional) Address of proxy to run connection through
Below, a sample recommended configuration for the Java Proxy Server agent.
{
"tokenFile": "/opt/sealights/sltoken.txt",
"proxyServerPort": 9000
}
Running the Sealights Java Proxy Server process
The Sealights Java Proxy Server process needs to be running as its own process in a location that the Test Listener javaagent has access to through the defined port and has outbound access to Sealights
The proxy should be used for one Test Listener only, usually running on the same machine as the JVM with the javaagent
java -jar sl_proxy_server.jar
or
java -Dsl.config.file=./slProxyCfg.json -jar sl_proxy_server.jar
Running the Sealights Test Listener against the Java Proxy Server process
All you need to do is add the flag sl.proxyServerHost flag set to the address and port of the proxy
Logging
The Sealights Java Proxy Server process uses the logback
logging framework and comes with the default logs configuration. The default configuration may be changed with an external configuration file.
By default the Sealights Java Proxy Server process logs to the console and to a file:
Console log configuration - error log level
File log configuration:
info log level;
log file path/name: logs/ProxyServer.log
files rolling is done when a file size reaches 1MB.; the rolled file will be renamed to ProxyServer-1.log