B4J Question Server & reverse proxy

wl

Well-Known Member
Licensed User
Longtime User
Hi,

I'm trying to implement a basic reverse proxy in jServer, by implementing a (Servlet) handler.

So: client (browser) -> jetty server (A) -> external server (B)

Problem is that I can't seem to get the body of the HTTP request to B and pass it (from A) to the browser using the GetAsynchronously call.

Anyone have an idea ?

Thanks

B4X:
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download(proxyURL)
    Wait For (j) JobDone (j As HttpJob)
    If j.Success Then
        resp.Status = j.Response.StatusCode
        j.Response.GetAsynchronously("response", resp.OutputStream, True, 1) 'Resp is the ServletResponse param of the Handle method.
        Wait For response_StreamFinish (Success As Boolean, TaskId As Int)
    Else
        Log ("error")
    End If
    j.Release
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…