C kore started while can't access

gdf

New Member
Joined
Mar 1, 2022
Messages
29
Reaction score
2
Credits
287
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
 


f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,432
Credits
43,802
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:
OP
G

gdf

New Member
Joined
Mar 1, 2022
Messages
29
Reaction score
2
Credits
287
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
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,432
Credits
43,802
What happens when you do it from the system where you are running the application?
Code:
curl http://127.0.0.1:8888
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,432
Credits
43,802
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?
 
OP
G

gdf

New Member
Joined
Mar 1, 2022
Messages
29
Reaction score
2
Credits
287
this is my hello project created by kore :124.223.60.250/hello.tar.gz

thanks
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,432
Credits
43,802
Can you explain what C kore framework is it will probably help me understand better how to run your program?
 
OP
G

gdf

New Member
Joined
Mar 1, 2022
Messages
29
Reaction score
2
Credits
287
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
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,432
Credits
43,802
And how do you run it after you create it with kodev?
 
OP
G

gdf

New Member
Joined
Mar 1, 2022
Messages
29
Reaction score
2
Credits
287
in helloProject root directory,"typing '"kodev run"'
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,432
Credits
43,802
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:
[[email protected] ~]# 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.
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,432
Credits
43,802
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.
 
OP
G

gdf

New Member
Joined
Mar 1, 2022
Messages
29
Reaction score
2
Credits
287
so I change the ip address where configured in hello.conf to 0.0.0.0
now I can browse the blank page online!
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,432
Credits
43,802
Yes or just the ip adress of the system.
 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com


Top