[Libwebsockets] Minimal examples for webserver

Pranjali Chumbhale pranjalic at safeai.ai
Wed Mar 4 20:02:34 CET 2020


Hello Andy,

Yes, my current directory is example directory.

├── build
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   │   ├── 3.10.2
│   │   │   ├── CMakeCCompiler.cmake
│   │   │   ├── CMakeCXXCompiler.cmake
│   │   │   ├── CMakeDetermineCompilerABI_C.bin
│   │   │   ├── CMakeDetermineCompilerABI_CXX.bin
│   │   │   ├── CMakeSystem.cmake
│   │   │   ├── CompilerIdC
│   │   │   │   ├── a.out
│   │   │   │   ├── CMakeCCompilerId.c
│   │   │   │   └── tmp
│   │   │   └── CompilerIdCXX
│   │   │       ├── a.out
│   │   │       ├── CMakeCXXCompilerId.cpp
│   │   │       └── tmp
│   │   ├── cmake.check_cache
│   │   ├── CMakeDirectoryInformation.cmake
│   │   ├── CMakeOutput.log
│   │   ├── CMakeTmp
│   │   ├── feature_tests.bin
│   │   ├── feature_tests.c
│   │   ├── feature_tests.cxx
│   │   ├── lws-minimal-ws-server-timer.dir
│   │   │   ├── build.make
│   │   │   ├── C.includecache
│   │   │   ├── cmake_clean.cmake
│   │   │   ├── DependInfo.cmake
│   │   │   ├── depend.internal
│   │   │   ├── depend.make
│   │   │   ├── flags.make
│   │   │   ├── link.txt
│   │   │   ├── minimal-ws-server.c.o
│   │   │   └── progress.make
│   │   ├── Makefile2
│   │   ├── Makefile.cmake
│   │   ├── progress.marks
│   │   └── TargetDirectories.txt
│   ├── cmake_install.cmake
│   ├── lws-minimal-ws-server-timer
│   └── Makefile
├── CMakeLists.txt
├── localhost-100y.cert
├── localhost-100y.key
├── minimal-ws-server.c
├── mount-origin
│   ├── example.js
│   ├── favicon.ico
│   ├── index.html
│   ├── libwebsockets.org-logo.svg
│   └── strict-csp.svg
└── README.md

Yes, I see that tcp socket in listen state for port 7681 uisng that netstat
command.
Still, I get 404 erorr for http:localhost:7681

Regards,
Pranjali


On Wed, Mar 4, 2020 at 10:57 AM Andy Green <andy at warmcat.com> wrote:

>
>
> On 3/4/20 6:47 PM, Pranjali Chumbhale wrote:
> > Hello Team,
> >
> > I am building and running the minimal examples for ws-server at my end
> > without -s option.
> > The server starts, however, netstat command does not show anything on
>
> You're not asking it to tell you what you want to know.
>
> > the port 7681 (I am using the default port as in example).
> > Also, http://localhost:7681 shows 404 error.
> >
> > Did anyone face this issue?
>
> Are you running it with the current directory being the example dir?
> Because the server examples are built to get their assets from ./, eg,
> ./mount-origin so they can avoid having to deal with crossplatform
> boilerplate for where to install things obscuring the important bits of
> what the example is trying to demonstrate.
>
> > _Here is starting the server output:_
> > ./lws-minimal-ws-server-timer
> > [2020/03/04 10:35:09:4276] U: LWS minimal ws server | visit
> > http://localhost:7681 (-s = use TLS / https)
> >
> > _And here is the netstat command output:_
> >
> > netstat | grep 7681
> > unix  3      [ ]         STREAM     CONNECTED     517681
>
> That's not telling you anything, if you want to see who is listening on
> tcp you want, eg netstat -ltn
>
> -Andy
>
> >
> > Regards,
> > Pranjali
> >
> > _______________________________________________
> > Libwebsockets mailing list
> > Libwebsockets at ml.libwebsockets.org
> > https://libwebsockets.org/mailman/listinfo/libwebsockets
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200304/9ba629bd/attachment.htm>


More information about the Libwebsockets mailing list