# Using WebIO with IJulia on AWS sever

**URL:** <https://discourse.julialang.org/t/using-webio-with-ijulia-on-aws-sever/22847>\
**Category:** General Usage\
**Created:** [April 6, 2019, 6:45pm UTC](https://discourse.julialang.org/t/using-webio-with-ijulia-on-aws-sever/22847 "2019-04-06T18:45:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![orhan\_abar](https://avatars.discourse-cdn.com/v4/letter/o/e5b9ba/32.png) [@orhan\_abar](https://discourse.julialang.org/u/orhan_abar)\
**Post date:** [April 6, 2019, 6:45pm UTC](https://discourse.julialang.org/t/using-webio-with-ijulia-on-aws-sever/22847/1 "2019-04-06T18:45:43Z")

</div>

Hello,  
I am developing the [CurricularAnalytics](https://github.com/CurricularAnalytics/CurricularAnalytics.jl) toolbox and I am using Blink for terminal usage and WebIO scope for IJulia. It works fine at my local machine. But when create a server running Jupyter notebook it doesn’t show the visualization.  
I am adding the way I create server on localhost and call it but it is open source so you can open this [link](https://github.com/CurricularAnalytics/CurricularAnalytics.jl/blob/master/src/Visualization.jl) to see the actual codes.

```julia
const LOCAL_EMBED_PORT = 8156
const LOCAL_EMBED_FOLDER = joinpath(dirname(pathof(CurricularAnalytics)),"..","embed_client","dist")

```

```julia
function get_embed_url()
        local_embed_url = string("http://localhost:", LOCAL_EMBED_PORT)
        try
            HTTP.request("GET", local_embed_url)
        catch
            serve_local_embed_client()
        end
        return local_embed_url
end

```

```julia
function serve_local_embed_client()
    @async HTTP.serve(HTTP.Sockets.localhost, LOCAL_EMBED_PORT) do req::HTTP.Request
        # default render index.html case
        req.target == "/" && return HTTP.Response(200, read(joinpath(LOCAL_EMBED_FOLDER, "index.html")))

        # construct file location from request target
        file = joinpath(LOCAL_EMBED_FOLDER, HTTP.unescapeuri(req.target[2:end]))

        # determine / set content type
        content_type = "text/html"
        if (occursin(r".js$", file))          
        content_type = "application/javascript"
        elseif (occursin(r".css$", file))     
        content_type = "text/css"
        end
        Messages.setheader(req, "Content-Type" => content_type)

        # return file or 404 if not present
        return isfile(file) ? HTTP.Response(200, read(file)) : HTTP.Response(404)
    end
end

```

Any idea or help will be appreciated.

The error I am getting is " **localhost** refused to connect."
