B4i Library SD: iHttpServer (beta)

Star-Dust

Expert
Licensed User
Longtime User
great!! now the example is working.

can i set a static folder to send my whole site? including css/js files?
As I wrote it is still under development but will have this function.
Now you can receive requests and reply with text, in the future you can also send files.

Unfortunately I don't have time, I have many ideas and little time.
 

Star-Dust

Expert
Licensed User
Longtime User
I am happy to present the most important update of this library. It doesn't have all the features expected on a server but a significant step has been taken.

Update 0.50
  • Added SendFile
  • Updated the example

Try
After starting the example on the mobile device, you can access the page from the browser of your pc by indicating the ip address of the mobile device and the port chosen. (better if it is on a local network)
For example: http://192.168.1.100:51051

 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Looks amazing. Will test it later. How much is the paid cersion?
There is no paid version. It is not a DEMO version but BETA.
It is still under development and is free, I assume it will remain free because I believe it is a basic library of a language.
 

ilan

Expert
Licensed User
Longtime User
hi Start-Dust, i have tried it and i see the huge step you did. although i am getting lots of bugs. for example if i type the ip to connect sometimes i get the page rendered and sometimes i get the HTML Text printed instead.

another thing i noticed is that if i have a page that has a css file linked the html is not able to load it but if i disconnect the connections (stop the debug process) the page loads the css file. can it be that you send the css file after you send the index.html and thats why index.html doesnot find the css file? maybe the index.html should be sent at the end after all files have been sent.

i understand that it is a demo and still in development and that you also dont have much time but if you like i would love to join the development and try to help you finish the project. if you are interested let me know

thank you for your great job. i will send you a beer to cool down
 

Star-Dust

Expert
Licensed User
Longtime User
I have to look into this before I answer.

As a matter of fact, I can answer that the server always sends only the source and the browser that does the rendering. So there is some error where the browser translates the html page to txt. It will be less of a problem.

For CSS, the server does not send before or after, but only when the browser requests it. That is, after having 'read' the html source, it becomes aware of the presence of a CSS file and requests it from the server. I have not tested this, as soon as possible I will let you know.

Thanks for the offer of help, I can't work with 4 hands and I should explain the sources and reasons for some choices, even for this it takes time unfortunately. But I'll think about your proposal.

Thanks for the beer, only after drinking it I'm no longer lucid and I feel sleepy
 

Star-Dust

Expert
Licensed User
Longtime User
hi Start-Dust, i have tried it and i see the huge step you did. although i am getting lots of bugs. for example if i type the ip to connect sometimes i get the page rendered and sometimes i get the HTML Text printed instead.
Does this problem give you in the example? On which html page?

Send me privately an example that I can try with CSS where it introduces you to the flaw
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.06
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.65
  1. Fix Bugs
  2. Improved the SendFile method by including MIME related to file types
  3. Improved SendString (sending with Header) and added SendWrite (without header to dynamically send more text after the SendString)
According to the roadmap, GetUploadFile is missing
There will probably be no TempFolder to upload files to send directly from an internal folder
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Update 0.66
  1. Fix Bugs
  2. Support for UpLoad files
  3. I change the name of the main class from Server to httpServer to avoid confusion with other libraries
  4. Update Example
 
Last edited:

ilan

Expert
Licensed User
Longtime User
Update 0.66
  1. Fix Bugs
  2. Support for UpLoad files
  3. I change the name of the main class from Server to httpServer to avoid confusion with other libraries
  4. Update Example

really nice @Star-Dust
i tested the file upload function and on chrome it works fine.
on firefox after i upload 1 file i have to press F5 to refresh the site to be able to upload another file.
in chrome i dont need to do that but firefox i am not able to upload 1 file after another if i dont refresh the site again.
 

Star-Dust

Expert
Licensed User
Longtime User
Okay, I'll do some tests. Each browser has a different answer.
 

Star-Dust

Expert
Licensed User
Longtime User

ilan

Expert
Licensed User
Longtime User
thank you very much @Star-Dust. i managed to make a working example on a dynamic web app that can be modified from the b4i server.

video:


awesome library, keep improving it!
this may be the solution for b4i web server we all look for.

on chrome it works fine, firefox needs to refresh after 1 file upload (as already mentioned above)


btw this is a real phone (iphone 11) connected to Reflector running on my windows 10. so it is really working!!!

EDIT: short explanation of the purpose of this webserver. you run a server on your ios device -> connect to the device by entering the wifi IP (locally only) and now you can download or upload any file you want to your ios device from any web browser. very simple and powerful way of transfering files from/to your ios device.
 
Last edited:

ilan

Expert
Licensed User
Longtime User
just noticed that in release mode the app crashes each time i use the upload function. in debug mode it is working fine but in release mode the app crashes.
 

Star-Dust

Expert
Licensed User
Longtime User
just noticed that in release mode the app crashes each time i use the upload function. in debug mode it is working fine but in release mode the app crashes.
It was fixed in the latest update.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…