How to forward from proxy

When you are writing a proxy; after having intercepted the request/response. Two questions:
1. if you intercepted a request and you did what you had to do; to forward the request, do you just have to open a socket connection to the web server on port 80 and send the request line per line using PrintWriter?
2. if you intercepted a reply , you just have to open a socket connection to the client on the 'proxy port' (e.g. 8080) and again send the reply line per line with PrintWriter?
Or am I getting it completely wrong?
thanks

can u send me the .java files of the prog
[email protected]

Similar Messages

  • "How to forward from a struts form to a login page?"or "how to connect form

    Can Any boby please let me know
    "How to forward from a struts form to a login page?"or "how to connect form to login session id"?
    Thanks
    Shailajakrishna

    I believe I can not use a
    request.sendRedirectURL("....") in which I would
    encode all my parameters, because:Righto. This is a bit tricky.
    Basically, you have two options, and both of those are a little nasty.
    1) You could use and intermediate JSP page. Just dispatch you request to that page, use the attributes to construct a form with hidden fields, and use Javascript to POST that form to your intended URL on the document's BODY onload event. Would work, but wouldn't be pretty and requires you to use JSPs and Javascript. Still an idea.
    2) This is something that I wouldn't recommend. Open a socket to the URL you you want to post your data. Manually construct a HTTP POST request, encoding your parameters into the headers. Read and parse the response & modify your HttpServletResponse object accordingly.
    Take a look at i.e. http://javaalmanac.com/egs/java.net/PostSocket.html?l=new for some pointers.
    I'd go with item #1.
    For my own edification, I'd be also interested in
    knowing why such a function does not exist in the
    current httpServletRequest api.I suppose it's a little out of scope. Servlets were ment to interoperate inside one container, not across domains and different implementations.
    I'm guessing I must be missing something fundamentals
    maybe?No, you're not.
    .P.

  • How to forward from a servlet to a (secured) jsp

    hi all
    actually i am trying to forward a request from a servlet to a jsp which is located in the WEB-INF-directory of the web-app...
    as i read in the docs the path in the getRequestDispatcher-method must start with a "/" so i tried to get a requestDispatcher-object from this path:
    /WEB-INF/secureJSP/abc.jsp...
    but all i get is a FileNotFoundException: no ressource "..." in the servlet context root "..."
    if i put the jsp in the web-app-root (like /abc.jsp) i am able to get a requestDispatcher-object without troubles...
    whats wrong? any ideas?
    tia
    sandro

    Hi
    Let me clarify this for you, Firstly as I said the WEB-INF directory is not accessible to the browser i.e a user couldn't possibly type in http://server-name:port-number/myapp/WEB-INF/test.jsp - This wouldn't work. But what you can do is forward a request to the jsp through a servlet using the RequestDispatcher.
    The RequestDispatcher object can be obtained in two ways. One is from the servletContext and the other is from the request. If it is obtained from the servletContext then the path is interpreted relative to the root of the web application. If it is got from the request without the "/" then the path is interpreted relative to the current request servicing resource.
    In your case get the RequestDispatcher from the ServletContext and provide the path as you have provided - assuming that WEB-INF directory is just below your myapp directory.
    Keep me posted on your progress & sorry for the confusion.
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems inc
    http://www.sun.com/developers/support

  • How to forward from a jsp  to another jsp on another server

    I am facing issue in forwarding to a jsp residing in another server. While using response.redirect(url), the response is send back to the browser and then redirected(which is not expected as it would create problem in production). i am facing issue while using the <jsp: forward> tag and forward() as they seem to be taking relative URL. Please help me with this issue.

    probably, you could use <c:redirect url=""/> tag to request to jsp on another server and pass ur parameters as 'GET' so that u can get all your respective params values. Other way (or crude) way is to do a scoket or HttpConnection to post your all datas via 'POST' and expect respective values on the server side.

  • Forward from action directly to anther action

    Hi all,
    I have the following problem: I have a pageflow application for administering complex configuration. On the main page (where user is forwarded from begin action, begin action reads data from configuration and fills them into form bean and main page displays them) is link for editation of part of configuration, link references to editaction which fills formbean and forwards to form for partial editation. This form submits to saveaction which stores data, and forwards to begin action directly. And here is the problem, somewhere in the portal framework between invocation of saveaction and begin following error is written into log.
    25 X 2006 16:55:58,560 ERROR ArrayIndexToken [ExecuteThread: '13' for queue: 'default'][]: Could not update expression because a public field named "operation" or setter for the property "operation" could not be found.
    I think, that this is beause form data is submitted and handled by saveaction, but because than forward to begin happens, portal tries to to fill submitted form data into formbean of begin action as well, but this formbean is different one and doesn't have corresponding properties. Both formbeans are scoped to request.
    In this particular case it causes no other problem than logging aforementioned error, but in other cases when property names would accidentaly match it may cause some problems with data, so I consider this beaviour as dangerous and want to avoid it.
    So my question is, how to forward from action to action without passing form data which were already handled by first action?

    The problem what I would like to solve is the following:
    I have some information stored on a DB. Depending of these information I would like to show different information on a jsp page with the help of jsf. (This jsp file is reached already with the help of navigation rules of jsf technology)
    An action bean class is instantiated already when the generation of my jsp file started and the information are stored on this object in member variables. There is a boolean variable among these stored information and if the value of it is true, then I would like to send the user "automatically" to another jsp file (using the navigation rules of jsf).
    If I would not use jsf, then I would do something like the following:
    I would store the value of the boolean variable into the session, and I would use a jstl "if " tag to ask the value of this variable and when it would be true then I would use a <jsp:forward...> to send the user to the next page.
    My problem is I can not solve this with the jsf navigation rules?
    If I try to do something similar with jsf than #{myClass.newPage} is not accepted by jsp:forward tag of course, but I do not know a solution instead of it in jsf.
    Is exist a solution in jsf for it?
    If not, how can I create a similar sequence?
    vikot

  • How to get auto proxy configuration from plugin?

    I need to retrieve the name of the client's proxy server to pass it along to my signed applet (because it doesn't seem to be getting the information automatically despite the fact that the java plugin is set to the use the browser settings for proxies).
    The Java Plugin loads the proxy server information based on the browser preferences, but I haven't figured out how to retrieve that proxy information from the Plugin itself. Sometimes the javaplugin.proxy.auto.url system property is null, even if the browser (MSIE) is configured to use an auto-configuration script/url for the proxy server configuration. I can see in the Java Console that the plugin knows the auto-config url, so how can I access that property from within my applet?
    Even if javaplugin.proxy.auto.url is not null, I don't know how to call the javascript function at that URL from within the applet to get the proxy server host name and port.
    Does anyone know how to get the proxy information from the plugin?

    Thank you! Indeed, the answer was there, but I hadn't been able to find it earlier (I guess I was searching on the wrong forums). For those who might be interested, here's the thread that helped:
    http://forum.java.sun.com/thread.jsp?forum=30&thread=281981

  • How can i create proxy service from another proxy on different domain

    i have a demo webservice. it has many operations on proxy service's message flow. How can i create proxy service from demo's wsdl on different domain
    Edited by: fresh man on Jul 1, 2012 11:17 PM

    You can either export the WSDL in a sbconfig.jar and then import this sbconfig.jar in the new domain. Then you can create a new Proxy in new domain based on the WSDL you imported.
    Alternatively, you can open the WSDL in the old domain, copy the text content of WSDL, then open new domain sbconsole and create a new WSDL type resource and paste the content you copied from old domain WSDL here. Then you can create a new Proxy Service based on this WSDL resource you created.
    Although, may I ask why do you need to create this new Proxy Service on a different domain? If you want to create a service similar to existing Proxy Service on different domain, then you can export the existing proxy service along with any dependencies to a sbconfig.jar and them import them in any other domain.
    If you want your new Proxy Service to invoke the existing Proxy on different domain, then you need to create a Business Service in the new domain (calling domain) which can invoke your existing Proxy service in other domain.

  • How can i create proxy service from wsdl on different domain

    i have a demo webservice. it has many operations on proxy service's message flow. How can i create proxy service from demo's wsdl on different domain

    Hi fresh man
    This is the Oracle Forms forum, and your query has nothing to do with Forms.
    Please post on {forum:id=75}.
    Please search first. It usually helps to search before you post.
    Regards,

  • How to forward message to two different queue using jms proxy service

    Hi all,
    In my project I need to listen to one jms queue then forward the messages to two different queue.
    Now I already made one proxy for listening to the queue then pass it to another queue using business service, It works.
    But how to forward the messages to two different queue in same flow process using one proxy and bs??
    or any other way?
    Really thanks in advance.
    Regards,
    Kahlil

    Hi,
    I have a MQ queue and i created a Proxy to listen to the queue , but i dont see any activity in OSB logs ..how do i knw if OSB proxy is polling that MQ ( mq is the transport protocol that i am using ) .
    Thanks
    Prarthana.

  • How to forward alert from one user to another user and how to reject?

    Hi everybody.
    How to forward alert from one user to another user and how to reject and how to complete alert?
    Regards,
    Vinay.

    What alert are you talking about? Which version of BOE / Edge do you use?

  • Example how to forwards an email from OCS via API ?

    is there a working example available, how to forward an email with known msg_id from a user's inbox ?

    This has something to do with Java? In html, create a mailto: url.

  • How I forward text from one iphone 4 to other, only forward the calls

    how I forward text from one iphone 4 to other, only forward the calls

    you can't forward incoming texts to another phone automatically.

  • How to do port forwarding from wla2-g54l Buffalo bridge to mac mini

    Hi,
    I am trying to get Azurus to remove the "firewall block" message and I think I have narrowed it down to port forwarding.
    I have set up port forwarding from my X modem to the Airport Xpress base station. I have then set up the port forwarding from the base station to the buffalo.
    The problem I have had is setting up the wla2-g54l to forward the same port to the mac mini....
    any Ideas? Not much luck on the Buffalo website.. and I have RTFM. Many times!
    Cheers
    Mac Mini G4 1.2Gz   Mac OS X (10.4.8)  

    It sounds like your set-up is in a horrible mess with 3 levels of NAT going on.
    What you should really have is the X-Modem configured in it's default mode "Modem Mode" where there will be no need to do any port forwarding as the modem is acting as a pure modem without having any influence over ports.
    Then the Airport express should be configured to "Distribute IP addresses" so that the Airport is acting as a router. I presume that you use the Buffalo unit as a repeater for the AIrport so you should set-up WDS so that both are on the same network. Then your computers will all be using IP addresses in the 10.0.1.x range as issued by the Airport. You can then configure the Airport to directly forward ports to the IP address of your computer. Therefore only one instance of NAT and only one set of port forwarding rules.

  • How to do forward from one XML to other?

    Hello!
    I would to do forward from one XML to other like in HTML use tag <meta>:
    <meta http-equiv="REFRESH" content="0;url=http://...">
    Could XML to control HTTP query?

    I apologize, but your scenario still does not make sense to me.
    The user requests a URL, an XML page is returned to their browser, then immediately another XML page is returned to their browser?
    Maybe try to explain in functional terms what you're trying to achieve rather than assuming that "forwarding" or refreshing is the solution. Stated this way, I still don't have an idea of what kind of application you're trying to build.

  • [SOLVED] How to forward lan traffic from router to openvpn client....

    Hi all,
    I have maybe a strange situation. I recently started testing a VPN service on my home network. Ideally I would like most of my home machines to connect through this VPN. I am using it for both privacy and to circumvent geo-restricted sites. I have a router, Asus WL-500gp which is running the Tomato Firmware, and I did first attempt to setup OpenVPN on it which did work but didn't provide very much bandwidth due to probably not having enough processing power to deal with the encryption and the compression involved. I was only able to get about 5Mbit down when normally I get approx 30+ so this was not an acceptable performance hit.
    I then decided to try setting up the VPN on my media server which is running Arch(of course). This was easily accomplished and is working extremely well with approx 25Mbs down. An acceptable performance hit. Now, as it stands only this machine is running through the VPN, the rest of the machines are still connecting to the net normally through the router. Is there a way to have other devices on my lan also get forwarded through the VPN on my Arch server. I do realize I could run my server as a router but I would rather leave the tomato router for that as it works well and is easy to setup whereas I suspect it may be complicated to setup on Arch. Is it possible to configure the tomato to forward certain IP's(my wired network is all static ip's) or even MAC's to the media server rather than the ISP. I suspect it can be done with some new routes added in but I am not that familiar with routing tables to figure it out.
    So for example my tomato router is on ip 192.168.1.1, media server is on 192.168.1.2, xbmc 1 is on 192.168.1.3, xbmc 2 is on 192.168.1.4 etc. So say I would also like to have xbmc 1 and 2 go through the VPN as well. Is there a relatively simple way to accomplish this? I am thinking something along the lines of having the tomato forward request from IP 192.168.1.3-192.168.1.4 to 192.168.1.2(rather than the default gateway), then on the server tell it to forward these request to tun0(the VPN's network device).
    Any thoughts? Anyone done something like this?
    Thanks,
    Kevin
    Last edited by ould (2012-12-26 13:29:59)

    Xyne wrote:
    My first thought was to just set the server up as a router, but then I got to the part where you reject the idea. If you change your mind, you may find my recent notes on configuring something similar useful.
    I'm pretty much a networking noob so I may be way off, but I would try the following. Here I'm assuming that the lan and vpn interfaces on the server are eth0 and tun0, respectively. These commands are adapted from the aforementioned notes.
    On the server:
    # Enable IP forwarding.
    echo 1 > /proc/sys/net/ipv4/ip_forward
    # Allow postrouting to tun0. You may want to use "-s" here to strictly limit forwarding to IPs on your LAN.
    iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
    # Enable forwarding from the LAN to the VPN (and back via related and established connections).
    # Again, you may want to use "-s".
    iptables -A FORWARD -i eth0 -o tun0 -j ACCEPT
    iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
    After that, I think  you can you just need to set the server as the default gateway on the other machines. I am not familiar with the Tomato firmware, but I would expect there to be some easy way to do it there.
    You probably want the router to return the VPN's DNS servers instead of your ISP's DNS servers if you use DHCP on the LAN.
    Thank you very mach! It's has been useful for me when i wanna connect my VBox mashines to do my lab)

Maybe you are looking for

  • Reassign request in OIM 9.1.0.2. BP 19

    Hi Folks, I have come across a requirement. I want requester to reassign the requests raised by him to some one else. i.e. Whenever a person submit a request, it goes to his manager for approval. Now I want in view requests page, request should be ab

  • Save As PDF from Workbench

    I am using LiveCycle Workbench and wonder if there is a way to save an XDP straight out of Workbench as a PDF on a local drive?  Currently, I have to drag the XDP locally, open in local LiveCycle Designer and then Save As PDF.

  • Access a NetFlix account with Samsung TV, Samsung home theatre system w/netgear wireless router

    I just want to know what is required to wirelessly access a NetFlix account using my Samsung TV & Samsung home (DVD) theatre system with a Netgear wireless router.

  • Why won't app appear on my IPad? It says I've already downloaded it?

    However, when I go to the App Store it shows that I need to download it via the iCloud but a message saying already purchased appears. Any help would be appreciated.

  • Problem in search

    Hi when I use search button for searching in Web UI I get all search criterias and suppose I save the search based on some search criteria it gets displayed on the Saved searches,now when I click on Go button it gives me desired result list but when