Development Guide

Example - First Config

Our proxy, that we will create in the next chapter, will need to know the number of connection 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.

public class ExampleProxyConfig {
  private int connectionCount;

  public ExampleProxyConfig(int connectionCount) {
    this.connectionCount = connectionCount;

  public int getConnectionCount() {
    return connectionCount;

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

public class ExampleProxyConfigurator extends ConfigPane<ExampleProxyConfig> {
  @FXML private TextField connectionCountInput;

  public ExampleProxyConfigurator() throws IOException {

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

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

  public void setConfig(ExampleProxyConfig config) {

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.AnchorPane?>

<fx:root prefHeight="44.0" prefWidth="249.0" type="javafx.scene.layout.AnchorPane" xmlns="" xmlns:fx="">
      <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" />