# Purpose of application:
Proxy service, which constantly makes long-polling requests to public server, receives commands from there, sends these commands to local http service on android's localhost (Particularly for "IP Webcam" app), and transfers reply back to server.
# UI
It has two views:
- Home:
Status of service: running [Stop]
( Or: stopped [Run] )
Button [Configuration]
- Configuration:
Server origin: [________]
Server timeout: [ 30 ]
Local service origin: [________]
Local service timeout: [ 60 ]
[ Save ]
# Techn
Prototype of application implemented on noejs - Same logic of service should be implemented in JAVA:
github.com/garmoshka-mo/mobile-tunnel-server/blob/master/proxy_emulator.js
Server is running on public server, source code of server can be checked on github/garmoshka-mo/mobile-tunnel-server
Server listens for andorid client at POST `/tunnel/handle-request` and expecting multipart/form-data with (status, headers, data) or (error) fields.
Requirements:
- Service with continious long-polling loop should work in background even when application is closed.
- Android SDK: not higher than 4.3 (jelly bean), can be lower
Test criterias:
(this currently successfuly performed with nodejs script "proxy_emulator.js")
Launch "IP Webcam" on andorid and implemented service, it should:
- correctly transfer GET / (index page HTML and all related files)
- correctly transfer GET /photo.jpg (binary file, which is particularly image)
# Replying
Together with reply, please answers in few words to following brief-test questions:
- How would you attach binary data to multipart request in JAVA?
- In context of mobile internet - how to avoid "stuck" long-polling request with simple solution?