Android Question HTP server ERR_CONNECTION_REFUSED

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
B4X:
Logger connected to:  LGE VS425PP
--------- beginning of main
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (starter) Start **
*** Service (serverservice) Create ***
٢٠١٨-١٢-٠٩ ١٥:٢٥:31.113:INFO::jetty-7.x.y-SNAPSHOT
٢٠١٨-١٢-٠٩ ١٥:٢٥:31.190:INFO::started o.e.j.s.ServletContextHandler{/,null}
٢٠١٨-١٢-٠٩ ١٥:٢٥:31.221:INFO::Started BlockingChannelConnector@0.0.0.0:5555 STARTING
org.eclipse.jetty.server.Server@16d86549
** Service (serverservice) Start **
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **

@Erel That is all logs
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
B4X:
INFO::Started BlockingChannelConnector@0.0.0.0:5555 STARTING
I don't understand this line in the log? I called 127.0.0.1:5555
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
From another device/pc connected to the same network, it is connected to the server (example: 192.168.1.3:5555) & served successfully.
But from the same device (that host http server) all tries are "connection refused":-
0.0.0.0:5555 refused
127.0.0.1.5555 refused
localhost.5555 refused
192.122.36.44:5555 refused * this is my wifi ip

Please help
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
B4X:
Started BlockingChannelConnector@0.0.0.0:5555 STARTING
I googled the meaning of this.
I think the server service blocks all local ips to be connected to it
It accepts connection from lan ip
So:
Is it a bug in @Erel library HTTP Server?
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
Where is the client code? Does it work if you change 127.0.0.1 with localhost?
It is as the following:
B4X:
webview1.loadurl("http://127.0.0.1:5555/index.html")
index.html is a file located in asset folder.
Also localhost not work
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
WebView.LoadHTML
No can't do the job, because index.html file has linked with a lot of css/js files
It is complete website or HTML5 game ... and imagine that loadhtml can't render final appearance fine

So loadurl is the only job in webview can do it
 
Upvote 0
Top