// Path: rsimulator-proxy/src/main/java/com/github/bjuvensjo/rsimulator/proxy/config/ProxyModule.java
// public class ProxyModule extends AbstractModule {
//     private final Logger log = LoggerFactory.getLogger(ProxyModule.class);
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see com.google.inject.AbstractModule#configure()
//      */
//     @Override
//     protected void configure() {
//         // ***** Properties *****
//         URL resource = getClass().getResource("/URIMapper.txt");
//         if (resource == null) {
//             log.debug("No /URIMapper.txt resource exists.");
//         } else {
//             bind(File.class).annotatedWith(Names.named("uri-mappings")).toInstance(
//                     new File(resource.getFile()));
//         }
//     }
// }


import com.github.bjuvensjo.rsimulator.proxy.config.ProxyModule;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
package com.github.bjuvensjo.rsimulator.proxy;



/**
 * The Proxy servlet proxies as {@link URIMapper} is configured.
 */
@WebServlet(urlPatterns = "/*")
public class Proxy extends HttpServlet {
    private static final long serialVersionUID = 1L;
    private final Logger log = LoggerFactory.getLogger(Proxy.class);
    private static final int READ_TIMEOUT = 12000;
    @Inject
    private URIMapper uriMapper;
    @Inject
    private RequestHandler requestHandler;
    @Inject
    private ResponseHandler responseHandler;
    @Inject
    private SecurityHandler securityHandler;

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        try {
// Path: rsimulator-proxy/src/main/java/com/github/bjuvensjo/rsimulator/proxy/config/ProxyModule.java
// public class ProxyModule extends AbstractModule {
//     private final Logger log = LoggerFactory.getLogger(ProxyModule.class);
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see com.google.inject.AbstractModule#configure()
//      */
//     @Override
//     protected void configure() {
//         // ***** Properties *****
//         URL resource = getClass().getResource("/URIMapper.txt");
//         if (resource == null) {
//             log.debug("No /URIMapper.txt resource exists.");
//         } else {
//             bind(File.class).annotatedWith(Names.named("uri-mappings")).toInstance(
//                     new File(resource.getFile()));
//         }
//     }
// }


// Path: rsimulator-proxy/src/main/java/com/github/bjuvensjo/rsimulator/proxy/Proxy.java
import com.github.bjuvensjo.rsimulator.proxy.config.ProxyModule;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

package com.github.bjuvensjo.rsimulator.proxy;



/**
 * The Proxy servlet proxies as {@link URIMapper} is configured.
 */
@WebServlet(urlPatterns = "/*")
public class Proxy extends HttpServlet {
    private static final long serialVersionUID = 1L;
    private final Logger log = LoggerFactory.getLogger(Proxy.class);
    private static final int READ_TIMEOUT = 12000;
    @Inject
    private URIMapper uriMapper;
    @Inject
    private RequestHandler requestHandler;
    @Inject
    private ResponseHandler responseHandler;
    @Inject
    private SecurityHandler securityHandler;

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        try {
            Injector injector = Guice.createInjector(new ProxyModule());