aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-02-23 15:40:41 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-02-23 15:40:41 -0800
commita129cfd3159c02b4f3996dbdfb5299ac95a6720c (patch)
tree1d85533a859e444eff32d92730d0805f6aac08c5 /src/org/traccar/MainModule.java
parentb7d48127e60bcaa5d01f45d8df5203f28f9a1667 (diff)
downloadtrackermap-server-a129cfd3159c02b4f3996dbdfb5299ac95a6720c.tar.gz
trackermap-server-a129cfd3159c02b4f3996dbdfb5299ac95a6720c.tar.bz2
trackermap-server-a129cfd3159c02b4f3996dbdfb5299ac95a6720c.zip
Refactor remote address handler
Diffstat (limited to 'src/org/traccar/MainModule.java')
-rw-r--r--src/org/traccar/MainModule.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/org/traccar/MainModule.java b/src/org/traccar/MainModule.java
index 9b16185df..d9ff93b21 100644
--- a/src/org/traccar/MainModule.java
+++ b/src/org/traccar/MainModule.java
@@ -24,6 +24,7 @@ import org.traccar.config.Keys;
import org.traccar.database.IdentityManager;
import org.traccar.handler.DistanceHandler;
import org.traccar.handler.FilterHandler;
+import org.traccar.handler.RemoteAddressHandler;
import javax.ws.rs.client.Client;
@@ -66,6 +67,15 @@ public class MainModule extends AbstractModule {
@Singleton
@Provides
+ public static RemoteAddressHandler provideRemoteAddressHandler(Config config) {
+ if (config.getBoolean(Keys.PROCESSING_REMOTE_ADDRESS_ENABLE)) {
+ return new RemoteAddressHandler();
+ }
+ return null;
+ }
+
+ @Singleton
+ @Provides
public static WebDataHandler provideWebDataHandler(
Config config, IdentityManager identityManager, ObjectMapper objectMapper, Client client) {
if (config.getBoolean(Keys.FORWARD_ENABLE)) {