Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
how to send data from react to node

I'm Nodejs beginner, i'm using here rtsp-relay library for live streaming, currently it is working in frontend when URL is inlcuded, when creating a proxy object at server ' url: rtsp://.....@..../Stream/Channel/10,', but i dont want to include it there, i want to include it in frontend (user could write it in TextField) should i use fetch and send, any advice/help on this ? English is not my mother language, so could be mistakes.

const express = require('express');
const app = express();

const { proxy, scriptUrl } = require('rtsp-relay')(app);

const handle = proxy({
  url: `rtsp://.....@..../Stream/Channel/10`,
  // the URL above is credentials
  verbose: false,
  transport: 'tcp',
});

app.ws('/api/stream', handle );

app.get('/', (req, res) =>
  res.send(
    `hg`,
 
  ),
);

app.listen(5000);

React (material-ui):

const updateUrl = () => {
    return (
      <React.Fragment>
        <Box>
          <form
            onSubmit={handleUpdate}>
            <div>
              <Box>
                <Button
                  onClick={nulll}
                  aria-label="close-settings-popup">
                  <Close />
                </Button>
              </Box>
            </div>
            <FormGroup>
              <Box>
                <FormControl>
                  <TextField
                    type="text"
                    id="URL"
                    value={source}
                    onChange={handleChange}
                    label={
                      <Trans i18nKey="form.cameraForm.source">URL</Trans>
                    }
                  ></TextField>
                </FormControl>
              </Box>
            </FormGroup>
            <div>
              <Button type="submit" variant="contained" color="primary">
                Accept
              </Button>
            </div>
          </form>
        </Box>
      </React.Fragment>
    );
  };

this is what rtsp creator wrote:

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As far as I can understand with what you have asked, you need to create a websocket connection from the client-side.

const ws = new WebSocket('ws://localhost:3000/ws') //Your url should be here

This is a basic webscoket connection using JavaScript native WebSocket API, you can use either other libraries like socket.io.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!