Examples of IHttpRequestEngine


Examples of com.subgraph.vega.api.http.requests.IHttpRequestEngine

  }

  @Override
  public void run() {
   
    final IHttpRequestEngine requestEngine = createRequestEngine();
    final IHttpResponse response = sendRequest(requestEngine);
    if(response != null && !response.getBodyAsString().isEmpty()) {
      processResponseBody(response.getBodyAsString());
    }
  }
View Full Code Here

Examples of com.subgraph.vega.api.http.requests.IHttpRequestEngine

    }
  }

  private void startListener(IHttpProxyListenerConfig config) {
    IRequestOriginProxy requestOrigin = currentWorkspace.getRequestLog().getRequestOriginProxy(config.getInetAddress(), config.getPort());
    IHttpRequestEngine requestEngine = requestEngineFactory.createRequestEngine(IHttpRequestEngine.EngineConfigType.CONFIG_PROXY, requestEngineConfig, requestOrigin);
    requestEngine.setCookieStore(cookieStore);
    HttpProxyListener listener = new HttpProxyListener(config, transactionManipulator, interceptor, requestEngine, sslContextRepository);
    listener.registerEventHandler(listenerEventHandler);
    listenerMap.put(config.toString(), listener);
    listener.start();
    for (IHttpProxyServiceEventHandler handler: eventHandlers) {
View Full Code Here

Examples of com.subgraph.vega.api.http.requests.IHttpRequestEngine

import com.subgraph.vega.impl.scanner.requests.PostParameterRequestBuilder;

public class PathState implements IPathState {

  public static PathState createBasicPathState(ICrawlerResponseProcessor fetchProcessor, PathStateManager stateManager, PathState parentState, IWebPath path) {
    final IHttpRequestEngine requestEngine = stateManager.getCrawler().getRequestEngine();
    final IRequestBuilder rb = new BasicRequestBuilder(requestEngine, path);
    final PathState st = new PathState(fetchProcessor, stateManager, parentState, path, rb);
    if(parentState != null)
      parentState.addChildState(st, true);
    else {
View Full Code Here

Examples of com.subgraph.vega.api.http.requests.IHttpRequestEngine

  }

  public static PathState createParameterPathState(ICrawlerResponseProcessor fetchProcessor, PathState parentState, List<NameValuePair> parameters, int fuzzIndex) {
    if(parentState == null)
      throw new IllegalArgumentException("Parent of parameter path cannot be null");
    final IHttpRequestEngine requestEngine = parentState.getPathStateManager().getCrawler().getRequestEngine();
    final IRequestBuilder rb = new GetParameterRequestBuilder(requestEngine, parentState.getPath(), parameters, fuzzIndex);
    final PathState st = new PathState(fetchProcessor, parentState.getPathStateManager(), parentState, parentState.getPath(), rb);
    parentState.addChildState(st, false);
    return st;
  }
View Full Code Here

Examples of com.subgraph.vega.api.http.requests.IHttpRequestEngine

  }

  public static PathState createPostParameterPathState(ICrawlerResponseProcessor fetchProcessor, PathState parentState, List<NameValuePair> parameters, int fuzzIndex) {
    if(parentState == null)
      throw new IllegalArgumentException("Parent of parameter path cannot be null");
    final IHttpRequestEngine requestEngine = parentState.getPathStateManager().getCrawler().getRequestEngine();
    final IRequestBuilder rb = new PostParameterRequestBuilder(requestEngine, parentState.getPath(), parameters, fuzzIndex);
    final PathState st = new PathState(fetchProcessor, parentState.getPathStateManager(), parentState, parentState.getPath(), rb);
    parentState.addChildState(st, false);
    return st;
  }
View Full Code Here

Examples of com.subgraph.vega.api.http.requests.IHttpRequestEngine

  private boolean isRescanNeeded() {
    if(!pathStateManager.isProxyScan() || response == null) {
      return false;
    }
   
    final IHttpRequestEngine requestEngine = pathStateManager.getCrawler().getRequestEngine();
    final List<Cookie> cookies = requestEngine.getCookiesForRequest(response.getHost(), response.getOriginalRequest());
    return !sameCookies(cookies, response.getSentCookies());
  }
View Full Code Here

Examples of com.subgraph.vega.api.http.requests.IHttpRequestEngine

    requestEngineConfig.setMaxConnections(config.getMaxConnections());
    requestEngineConfig.setMaxConnectionsPerRoute(config.getMaxConnections());
    requestEngineConfig.setMaximumResponseKilobytes(config.getMaxResponseKilobytes());
   
    final IRequestOriginScanner requestOrigin = workspace.getRequestLog().getRequestOriginScanner(scanInstance);
    final IHttpRequestEngine requestEngine = factory.createRequestEngine(IHttpRequestEngine.EngineConfigType.CONFIG_SCANNER, requestEngineConfig, requestOrigin);
    HttpProtocolParams.setUserAgent(requestEngine.getHttpClient().getParams(), config.getUserAgent());
    requestEngine.setCookieStore(cookieStore);
    // REVISIT: consider moving authentication method to request engine config
    IIdentity identity = config.getScanIdentity();
    if (identity != null && identity.getAuthMethod() != null) {
      identity.getAuthMethod().setAuth(requestEngine);
    }
View Full Code Here

Examples of com.subgraph.vega.api.http.requests.IHttpRequestEngine

    requestEngineConfig.setMaxConnections(config.getMaxConnections());
    requestEngineConfig.setMaxConnectionsPerRoute(config.getMaxConnections());
    requestEngineConfig.setMaximumResponseKilobytes(config.getMaxResponseKilobytes());
   
    final IRequestOriginScanner requestOrigin = workspace.getRequestLog().getRequestOriginScanner(scanInstance);
    IHttpRequestEngine requestEngine = requestEngineFactory.createRequestEngine(IHttpRequestEngine.EngineConfigType.CONFIG_SCANNER, requestEngineConfig, requestOrigin);
    HttpProtocolParams.setUserAgent(requestEngine.getHttpClient().getParams(), config.getUserAgent());
    // REVISIT: consider moving authentication method to request engine config
    IIdentity identity = config.getScanIdentity();
    if (identity != null && identity.getAuthMethod() != null) {
      identity.getAuthMethod().setAuth(requestEngine);
    }
   
    if (config.getCookieList() != null && !config.getCookieList().isEmpty()) {
      CookieStore cookieStore = requestEngine.getCookieStore();
      for (Cookie c: config.getCookieList()) {
        cookieStore.addCookie(c);
      }
    }   
View Full Code Here

Examples of com.subgraph.vega.api.http.requests.IHttpRequestEngine

    ctx.submitRequest(createRequest(ps, IPS_TEST), this, 0);
    ctx.submitRequest(createRequest(ps, IPS_SAFE), this, 1);
  }

  private HttpUriRequest createRequest(IPathState ps, String query) {
    final IHttpRequestEngine requestEngine = ps.getRequestEngine();
    final HttpHost host = ps.getPath().getHttpHost();
    final String requestLine = ps.getPath().getFullPath() + "?" + query;
    return requestEngine.createGetRequest(host, requestLine);
  }
View Full Code Here

Examples of com.subgraph.vega.api.http.requests.IHttpRequestEngine

  private final static int MAX_REQUEST_THREAD_COUNT = 100;
  private IHttpRequestEngineFactory requestEngineFactory;
 
  @Override
  public IWebCrawler create(IRequestOrigin requestOrigin) {
    final IHttpRequestEngine requestEngine = requestEngineFactory.createRequestEngine(IHttpRequestEngine.EngineConfigType.CONFIG_SCANNER, requestEngineFactory.createConfig(), requestOrigin);
    return create(requestEngine);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.