Development Guide

Example - First Config

Our proxy, that we will create in the next chapter, will need to know the number of fake connections it has to spawn. In order to do this, we will create our own proxy configuration.

Proxy Config

Let's define our proxy configuration that will contain number of fake connection the user wants to spawn.

 * Configuration of example proxy.
public class ExampleProxyConfig {
    private int connectionCount;

We need our configuration to be created by user, so let's create ConfigPane:

 * Configurator for example proxy.
public class ExampleProxyConfigurator extends ConfigPane<ExampleProxyConfig> {
    private TextField connectionCountInput;

    public ExampleProxyConfigurator() throws IOException {

    public ExampleProxyConfig getConfig() {
        return new ExampleProxyConfig(Integer.valueOf(connectionCountInput.getText()));

    public void setConfig(ExampleProxyConfig config) {

    public boolean isValid() {
        return connectionCountInput.getText().matches("-?\\d+");

We also have to create the template we specified in the constructor:

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.*?>

<fx:root xmlns:fx="" prefHeight="44.0" prefWidth="249.0" type="javafx.scene.layout.AnchorPane" xmlns="">
        <Label layoutX="7.0" layoutY="13.0" styleClass="input-label" text="Num of connections:" AnchorPane.leftAnchor="10.0" AnchorPane.topAnchor="13.0"/>
        <TextField fx:id="connectionCountInput" layoutX="129.0" layoutY="2.0" prefHeight="25.0" prefWidth="110.0" text="4" AnchorPane.leftAnchor="129.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="10.0"/>