ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/websocket/TesterWsWebSocketContainerWithProxy.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/websocket/TesterWsWebSocketContainerWithProxy.java
Status
scanned
Type
file
Name
TesterWsWebSocketContainerWithProxy.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2146 (2.1 KB)
MD5
5b781e9d5808261449b06f87682a7e4b
SHA1
7f5261d784103a0d59b88c0084a4697e17df8c9a
SHA256
f0817270e74458efbe0c6f60a7f51b985194077a7662514932b9968a2e2347c5
SHA512

      
    
SHA1_git
c1fca0f2f4d721965a80fb5fa0edeeac314f6ce7
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TesterWsWebSocketContainerWithProxy.java | 2.1 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomcat.websocket; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; /* * Additional infrastructure (a reverse proxy) is required to run this test. */ public class TesterWsWebSocketContainerWithProxy extends TestWsWebSocketContainer { @BeforeClass public static void init() { // Set the system properties for an HTTP proxy on 192.168.0.100:80 // I used an httpd instance configured as an open forward proxy for this // Update the IP/hostname as required System.setProperty("http.proxyHost", "192.168.0.100"); System.setProperty("http.proxyPort", "80"); System.setProperty("http.nonProxyHosts", ""); } @Before public void setPort() { // With httpd 2.2, AllowCONNECT requires fixed ports. From 2.4, a range // can be used. getTomcatInstance().getConnector().setPort(8080); Assert.assertTrue(getTomcatInstance().getConnector().setProperty("address", "0.0.0.0")); } @Override protected String getHostName() { // The IP/hostname where the tests are running. The proxy will connect // back to this expecting to find the Tomcat instance created by the // unit test. return "192.168.0.200"; } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
43.59
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9