B4J Library [B4X] xHttpServer (Http Server + jQuery)

Star-Dust

Expert
Licensed User
Longtime User
Now I understand. Sorry I misunderstood. Give me time to think what the problem might be
 

Star-Dust

Expert
Licensed User
Longtime User

laguilar

Member
Licensed User
Longtime User
Excellent! Apple appears to be accepting the application now. I have not worked with it long enough to really provide a whole lot of feedback, but the little bit I have used it, it appears very solid, minus the small hiccup of the ITMS-90338 error. Keep up the great work! Thanks again!
 

Star-Dust

Expert
Licensed User
Longtime User
See here

 

pixet

Member
Licensed User
Longtime User
How do I change the "Default Root" document folder of the server?
 

Star-Dust

Expert
Licensed User
Longtime User
Hi,

I suggest you see the examples. There is no default root because the class does not send replies automatically from a folder. But when the 'HandleWebSocket' event is raised inside the sub the response is sent you can fetch it from any folder or generate the response from code dynamically.

See the example in post n.2
 

sarmanho

Member
Licensed User
Longtime User
update rel. 0.78
fix bugs upload​
The upload example is not working. It is giving the error below:


Client has terminated (2)
index -1
servletrequest_vvvv3 (java line: 129)
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at b4a.example.servletrequest._vvvv3(servletrequest.java:129)
at b4a.example.servletrequest._vvvvvv5(servletrequest.java:1232)
at b4a.example.servletrequest._vvvvv0(servletrequest.java:754)
at b4a.example.servletrequest._vvvvvv4(servletrequest.java:1150)
at b4a.example.servletrequest._astream_newdata(servletrequest.java:266)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at anywheresoftware.b4a.BA$2.run(BA.java:395)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:250)
at android.app.ActivityThread.main(ActivityThread.java:7806)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
 

Star-Dust

Expert
Licensed User
Longtime User
Please provide an example that reproduces this problem.
 

Star-Dust

Expert
Licensed User
Longtime User
It happens with your upload example.
Event Svr_UploadProgress also doesnt work in the past version.
Thank you for your effort.
That I assume it is under the way, I did my tests with files of about 2MBs as indicated in another post and I had no difficulty. I have to be able to replicate the error to understand the reason. The access permits to the file could also be. However I will do further new texts next days
 

lucafabbri84

New Member
Hi Start-Dust.

Thanks for this library, really appreciated.

We figured out that there is a bug in the parameters decoding for an x-www-form-urlencoded request.

I've attached a simple example that shows the issue. Just run the projecton an Android device and click the button.
In the Logs you will find the errors I mentioned.

As a refernce for everybody:

>>> CLIENT: Orginal test string: 'Test accenti (àèò) & simboli € | Calcolo: "5+5=10" è al 100%?'
>>> CLIENT: Encoded text (standard): 'Test+accenti+%28%C3%A0%C3%A8%C3%B2%29+%26+simboli+%E2%82%AC+%7C+Calcolo%3A+%225%2B5%3D10%22+%C3%A8+al+100%25%3F'
>>> SERVER: I received the parameter: 'Test+accenti+(C3ĐC3ĘC3Ģ29+&simboli+Œ82ģCalcoloA"2D0"ijA8+al+100%3F'

Should you have a Github repository we can help to fix it.

Kindly
 

Attachments

  • TestServer.zip
    45 KB · Views: 43

Star-Dust

Expert
Licensed User
Longtime User
I can't check right now, I'm on vacation. Is the problem converting accented characters?
 

lucafabbri84

New Member
Hi Erel,

the issue is the decoding, the library decodes the strings using the windows-1252 charset in place of the utf8
 

Star-Dust

Expert
Licensed User
Longtime User
Hi Erel,

the issue is the decoding, the library decodes the strings using the windows-1252 charset in place of the utf8

The Library decodes as standard such as UTF-8, you can check CharacterenCoding in the Servletrequest and Servletrepsonse classes.
It is likely that it is your mistake, if you have a GitHub reposity I help you solve the bug
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…