C kore started while can't access

gdf

Member
Joined
Mar 1, 2022
Messages
30
Reaction score
2
Credits
300
Hello!
I am using C kore framework. I created an hello app by kodev create hello,and kodev build,run

netstat command shows it is working on 127.0.0.1:8888
but I can't access it on browser chrome and firefox.

tcpdump shows my hello server reset the request.
I do not know how to deal with it.Why I can't see the hello webpage?
port 8888 is open
os: centos
3.10.0-1160.71.1.el7.x86_64
kore version: 4.2.3

best wishes
 


Most browsers automatically redirect to https now days and your application is probably only configured to run http, try using curl to access that port. For example something like this.
Code:
curl http://192.168.122.10:8888
curl -I http://192.168.122.10:8888
 
Last edited:
Thank you for your reply!
But I still can't access it.
curl http://127.0.0.1:8888
error message like this:
curl: (56) Recv failure: Connection reset by peer
I also test it by using webbench
webbench --get -t 6 http://127.0.0.1:8888/
Requests: 0 susceed, 59982 failed.

netstat shows
tcp 0 0 127.0.0.1:49804 127.0.0.1:8888 TIME_WAIT
 
What happens when you do it from the system where you are running the application?
Code:
curl http://127.0.0.1:8888
 
I also test it by using webbench
webbench --get -t 6 http://127.0.0.1:8888/
Requests: 0 susceed, 59982 failed.
I have no idea what webbench is but since you are running that on localhost and it is failing, as well as the curl to localhost then you must have something not configured correctly for your application. Can you share a link to what C kore framework is, maybe I can try and run something on a test vm and see what happens then?
 
this is my hello project created by kore :124.223.60.250/hello.tar.gz

thanks
 
Can you explain what C kore framework is it will probably help me understand better how to run your program?
 
Yeah.
this is the kore project source
just build and install it.
after that we can use "kodev create appname" to init a c web project
 
And how do you run it after you create it with kodev?
 
When I do a curl from the system running it with https it works, when I do it from another system it doesn't work.
Code:
[root@rhel8 ~]# curl -Ik https://localhost:8888
HTTP/1.1 200 OK
server: kore (master-15071f5a)
connection: keep-alive
keep-alive: timeout=20
strict-transport-security: max-age=31536000; includeSubDomains
content-length: 0

The problem is that your application is specifically listening on localhost/127.0.0.1 and doesn't so it won't except connections from outside of that system.
Code:
tcp   LISTEN 0      128        127.0.0.1:8888      0.0.0.0:*    users:(("kore",pid=29502,fd=4),("kore",pid=29501,fd=4),("kore",pid=29500,fd=4),("kore",pid=29499,fd=4))
Compare that to apache.
Code:
tcp   LISTEN 0      128                 *:80               *:*    users:(("httpd",pid=4269,fd=4))
When I install a browser on the host running it succesfully connects but you get a blank page in the browser.
 
curl -Ik https://localhost:8888 ; it works!
Thank you!
Awesome! The -k(aka --insecure) is for ignore any invalid certificates, but you will still not be able to access it from systems outside of where it is running because it's running on 127.0.0.1:8888(localhost) and not on all interface or on 192.168.122.10:8888.
 
so I change the ip address where configured in hello.conf to 0.0.0.0
now I can browse the blank page online!
 
Yes or just the ip adress of the system.
 

Members online


Top