# Problem with stand alone

**URL:** <https://swi-prolog.discourse.group/t/problem-with-stand-alone/7639>\
**Category:** Help!\
**Tags:** how-to\
**Created:** [July 25, 2024, 9:17pm UTC](https://swi-prolog.discourse.group/t/problem-with-stand-alone/7639 "2024-07-25T21:17:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexisJQ](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@alexisJQ](https://swi-prolog.discourse.group/u/alexisJQ)\
**Post date:** [July 25, 2024, 9:17pm UTC](https://swi-prolog.discourse.group/t/problem-with-stand-alone/7639/1 "2024-07-25T21:17:36Z")

</div>

I’m using: SWI-Prolog version 9.3.8

I want to create a stand alone exe that can be executed in multiples machine without prolog installed, the exe run a web server with a local websocket.

My code looks like this:

```prolog
:- use_module(library(http/thread_httpd)).
:- use_module(library(http/http_dispatch)).
:- use_module(library(http/http_parameters)).
:- use_module(library(http/websocket)).
:- use_module(library(http/http_error)).
:- use_module(library(http/http_json)).
:- use_module(library(http/json_convert)).
:- use_module(library(http/json)).

main:- 
    server,
    thread_get_message(_).

% Star the server at port 9000
server :-
    http_server(http_dispatch, [port(9000)]).
        
:- http_handler(root(time),
    http_upgrade_to_websocket(time_handler, []),
    [spawn([])]).

time_handler(WebSocket) :-
    ws_receive(WebSocket, Message, [format(json)]),
    (
        Message.opcode == close
    ->
        true
    ;
        time_response(ResponseDict),
        ws_send(WebSocket, json(ResponseDict)),
        time_handler(WebSocket)
    ).

time_response(ResponseDict) :-
    get_time(Time),
    format_time(string(Message), '%c', Time),
    dict_create(Data, _, [message-Message]),
    dict_create(ResponseDict, _, [data-Data,format-json,opcode-text]).

```

And the exe it’s generated with

```prolog
qsave_program('websocket.exe', [stand_alone(true), foreign(copy), goal(main)]).

```

The problem occurs when running the exe on another machine as it does not run the websocket because it does not find certain modules, such as http\_stream.pl, websocket.pl, etc.
