Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8838981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:08:04+00:00 2026-06-14T10:08:04+00:00

import Network.Wai.Application.Static (staticApp, defaultWebAppSettings) import Network.Wai.Handler.WebSockets (intercept) import Network.Wai.Handler.Warp (runSettings, defaultSettings, settingsIntercept, settingsPort) main

  • 0
import Network.Wai.Application.Static (staticApp, defaultWebAppSettings)
import Network.Wai.Handler.WebSockets (intercept)
import Network.Wai.Handler.Warp (runSettings, defaultSettings, 
                                 settingsIntercept, settingsPort)

main :: IO ()
main = do
    let s = defaultSettings {settingsPort=9160, settingsIntercept=intercept app}
    runSettings s $ staticApp $ defaultWebAppSettings "www"

1) What I would like to know is if warp can distinguish between a websocket request and static request on the same port to prevent overhead by only running the static or the intercept app depending on the request.

http://hackage.haskell.org/packages/archive/wai-websockets/1.3.1/doc/html/src/Network-Wai-Handler-WebSockets.html

2) The above source file uses conduit, does that mean it is safe to use a strict ByteString for my websocket receiveData without worrying about potentially large amounts of incoming data that could overflow my memory or should I use a lazy ByteString instead?

Note that you can not chunk a websocket as in http chunked transfer encoding.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:08:06+00:00Added an answer on June 14, 2026 at 10:08 am
    1. If a websocket request is received, then the application itself will never be called, and your websocket handler will take over immediately.

    2. Without seeing your code, there’s no way to guarantee that you’re not reading it too much information. But it is possible to use a strict ByteString the way you’re describing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a network file transfer application. Using Lazy ByteString as a intermediate import
import wx class bucky(wx.Frame): # Creating the outer window/frame def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,'Karls Network Tool',
import org.joda.time.LocalDate; public class Test { public static void main(String[] args) { long time=System.currentTimeMillis();
import java.util.Scanner; public class CourseSplitter { public static void main(String args[]){ Scanner keyboard =
I'm using Network.Browser 4000.0.9 to retrieve a web page: import Network.Browser import Network.HTTP main
package session; import java.io.FileWriter; import java.text.DateFormat; import java.text.SimpleDateFormat; import javax.swing.JOptionPane; import org.openymsg.network.FireEvent; import org.openymsg.network.Session;
import Network import System.IO import Control.Concurrent import Control.Monad(when) import Char serverHandshake :: String serverHandshake
I'm trying to allow users to import their existing pictures to my social network.
I'm developing a network application and I want to get unit testing right. THIS
I have the basic hello world application setup using wai, and would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.